sf-documents 0.1.6 → 0.1.7

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,40 +1,39 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Pipe, InjectionToken, EventEmitter, ViewChild, Output, Input, Component, inject, ElementRef } from '@angular/core';
3
3
  import { BehaviorSubject, Subject, of } from 'rxjs';
4
- import * as i3$1 from 'primeng/api';
4
+ import * as i2$1 from 'primeng/api';
5
5
  import { ConfirmationService } from 'primeng/api';
6
- import * as i2$1 from 'primeng/dynamicdialog';
7
- import { DialogService } from 'primeng/dynamicdialog';
8
6
  import { ToastModule } from 'primeng/toast';
9
7
  import * as _ from 'lodash';
10
8
  import * as i1$1 from 'primeng/button';
11
9
  import { ButtonModule } from 'primeng/button';
12
- import * as i6$1 from 'primeng/confirmdialog';
10
+ import * as i5$1 from 'primeng/confirmdialog';
13
11
  import { ConfirmDialogModule } from 'primeng/confirmdialog';
14
12
  import { PanelModule } from 'primeng/panel';
15
- import * as i5 from 'primeng/checkbox';
13
+ import * as i4 from 'primeng/checkbox';
16
14
  import { CheckboxModule } from 'primeng/checkbox';
17
- import * as i2 from 'primeng/dialog';
15
+ import * as i8 from 'primeng/dialog';
18
16
  import { DialogModule } from 'primeng/dialog';
19
- import * as i9 from '@angular/common';
20
- import { CommonModule, DatePipe } from '@angular/common';
21
- import * as i3 from '@angular/forms';
17
+ import * as i1$2 from '@angular/common';
18
+ import { CommonModule, registerLocaleData, DatePipe } from '@angular/common';
19
+ import * as i2 from '@angular/forms';
22
20
  import { FormsModule } from '@angular/forms';
23
21
  import * as i1 from '@angular/platform-browser';
24
- import * as i6 from 'primeng/inputtext';
22
+ import * as i5 from 'primeng/inputtext';
25
23
  import { InputTextModule } from 'primeng/inputtext';
26
24
  import { InputIcon } from 'primeng/inputicon';
27
25
  import { IconField } from 'primeng/iconfield';
28
- import * as i7 from 'primeng/paginator';
26
+ import * as i6 from 'primeng/paginator';
29
27
  import { PaginatorModule } from 'primeng/paginator';
30
28
  import { debounceTime, distinctUntilChanged, takeUntil, tap, switchMap, finalize } from 'rxjs/operators';
31
- import * as i8 from 'primeng/select';
29
+ import * as i7 from 'primeng/select';
32
30
  import { SelectModule } from 'primeng/select';
33
- import * as i12 from 'primeng/dropdown';
31
+ import localeEs from '@angular/common/locales/es';
32
+ import * as i11 from 'primeng/dropdown';
34
33
  import { DropdownModule } from 'primeng/dropdown';
35
- import * as i13 from 'primeng/datepicker';
34
+ import * as i12 from 'primeng/datepicker';
36
35
  import { DatePickerModule } from 'primeng/datepicker';
37
- import * as i14 from 'primeng/skeleton';
36
+ import * as i13 from 'primeng/skeleton';
38
37
  import { SkeletonModule } from 'primeng/skeleton';
39
38
 
40
39
  class SfDocumentsService {
@@ -83,38 +82,90 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
83
82
 
84
83
  const DOCUMENT_SERVICE = new InjectionToken('DOCUMENT_SERVICE');
85
84
 
86
- const ALLOWED_UPLOAD_EXTENSIONS = ['.pdf', '.xls', '.xlsx'];
87
- const ALLOWED_UPLOAD_MIME_TYPES = [
88
- 'application/pdf',
89
- 'application/vnd.ms-excel',
90
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
91
- ];
92
- const UPLOAD_ACCEPT_ATTR = [...ALLOWED_UPLOAD_MIME_TYPES, ...ALLOWED_UPLOAD_EXTENSIONS].join(',');
93
- const EXCEL_EXTENSIONS = ['.xls', '.xlsx'];
94
- function isAllowedUploadFile(file) {
95
- return ALLOWED_UPLOAD_MIME_TYPES.includes(file.type) ||
96
- ALLOWED_UPLOAD_EXTENSIONS.some(ext => file.name.toLowerCase().endsWith(ext));
85
+ /**
86
+ * Extensiones permitidas por defecto para subir cuando el host no configura nada.
87
+ * Esto sí es configurable desde el host vía `allowedUploadTypes`, ya que es una
88
+ * decisión de negocio (qué tipos de documento se aceptan).
89
+ */
90
+ const DEFAULT_ALLOWED_UPLOAD_EXTENSIONS = ['.pdf', '.xls', '.xlsx'];
91
+ const MIME_TYPES_BY_EXTENSION = {
92
+ '.pdf': 'application/pdf',
93
+ '.xls': 'application/vnd.ms-excel',
94
+ '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
95
+ };
96
+ /**
97
+ * Extensiones que el navegador puede renderizar inline dentro de un <embed>/<iframe>.
98
+ * Esto NO es configurable desde el host: es una capacidad del navegador, no una
99
+ * decisión de negocio, así que la librería la conoce de antemano (evita que el host
100
+ * marque como "previsualizable" un tipo que en realidad nunca se va a renderizar).
101
+ */
102
+ const PREVIEWABLE_EXTENSIONS = ['.pdf', '.jpg', '.jpeg', '.png', '.gif', '.webp', '.bmp', '.svg'];
103
+ const ICON_BY_EXTENSION = {
104
+ '.pdf': 'pi-file-pdf',
105
+ '.xls': 'pi-file-excel',
106
+ '.xlsx': 'pi-file-excel',
107
+ '.doc': 'pi-file-word',
108
+ '.docx': 'pi-file-word',
109
+ '.jpg': 'pi-image',
110
+ '.jpeg': 'pi-image',
111
+ '.png': 'pi-image',
112
+ '.gif': 'pi-image',
113
+ '.webp': 'pi-image',
114
+ '.bmp': 'pi-image',
115
+ '.svg': 'pi-image'
116
+ };
117
+ /** Normaliza una lista de extensiones dada por el host (con o sin punto, mayúsc/minúsc). */
118
+ function normalizeExtensions(extensions, fallback) {
119
+ const list = extensions && extensions.length ? extensions : fallback;
120
+ return list
121
+ .map(ext => ext.trim().toLowerCase())
122
+ .filter(ext => !!ext)
123
+ .map(ext => (ext.startsWith('.') ? ext : `.${ext}`));
97
124
  }
98
- function isExcelFileName(name) {
99
- if (!name)
125
+ /** Arma el atributo `accept` del input file a partir de las extensiones permitidas. */
126
+ function buildAcceptAttr(extensions) {
127
+ const mimeTypes = extensions.map(ext => MIME_TYPES_BY_EXTENSION[ext]).filter((m) => !!m);
128
+ return [...new Set([...mimeTypes, ...extensions])].join(',');
129
+ }
130
+ function hasExtension(fileName, extensions) {
131
+ if (!fileName)
100
132
  return false;
133
+ const lower = fileName.toLowerCase();
134
+ return extensions.some(ext => lower.endsWith(ext));
135
+ }
136
+ function isAllowedUploadFile(file, extensions) {
137
+ const mimeTypes = extensions.map(ext => MIME_TYPES_BY_EXTENSION[ext]).filter((m) => !!m);
138
+ return mimeTypes.includes(file.type) || hasExtension(file.name, extensions);
139
+ }
140
+ /** true si el navegador puede mostrar este archivo inline en un <embed>/<iframe>. */
141
+ function canPreviewFile(name) {
142
+ return hasExtension(name, PREVIEWABLE_EXTENSIONS);
143
+ }
144
+ /** Ícono PrimeIcons según la extensión del archivo; 'pi-file' si no se reconoce. */
145
+ function getFileTypeIcon(name) {
146
+ if (!name)
147
+ return 'pi-file';
101
148
  const lower = name.toLowerCase();
102
- return EXCEL_EXTENSIONS.some(ext => lower.endsWith(ext));
149
+ const match = Object.keys(ICON_BY_EXTENSION).find(ext => lower.endsWith(ext));
150
+ return match ? ICON_BY_EXTENSION[match] : 'pi-file';
103
151
  }
104
152
 
105
153
  class UploadDialogComponent {
106
154
  selectedDocument;
155
+ /** Extensiones permitidas para subir (ej. ['.pdf', '.xlsx']). Si no se define, usa el default de la librería. */
156
+ allowedExtensions;
107
157
  onUploaded = new EventEmitter();
108
158
  loadFile = new EventEmitter();
109
- visible = false;
110
- acceptedFileTypes = UPLOAD_ACCEPT_ATTR;
111
159
  fileInput;
112
160
  constructor() { }
113
- showDialog() {
114
- this.loadFile.emit();
115
- this.visible = true;
161
+ get normalizedExtensions() {
162
+ return normalizeExtensions(this.allowedExtensions, DEFAULT_ALLOWED_UPLOAD_EXTENSIONS);
163
+ }
164
+ get acceptedFileTypes() {
165
+ return buildAcceptAttr(this.normalizedExtensions);
116
166
  }
117
167
  loadFileClick() {
168
+ this.loadFile.emit();
118
169
  this.fileInput.nativeElement.value = '';
119
170
  this.fileInput.nativeElement.click();
120
171
  }
@@ -123,20 +174,21 @@ class UploadDialogComponent {
123
174
  if (!input.files?.length)
124
175
  return;
125
176
  const files = Array.from(input.files);
126
- const validFiles = files.filter(f => isAllowedUploadFile(f));
177
+ const validFiles = files.filter(f => isAllowedUploadFile(f, this.normalizedExtensions));
127
178
  const imagePathInput = input.value;
128
179
  if (validFiles?.length)
129
180
  this.onUploaded.emit({ fileList: validFiles, tagValue: imagePathInput });
130
- this.visible = false;
131
181
  }
132
182
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: UploadDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
133
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: UploadDialogComponent, isStandalone: true, selector: "lib-upload-dialog", inputs: { selectedDocument: "selectedDocument" }, outputs: { onUploaded: "onUploaded", loadFile: "loadFile" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<button pButton type=\"button\" label=\"Subir archivo\" icon=\"pi pi-upload\"\r\n class=\"p-button-outlined ff-btn-upload\"\r\n (click)=\"showDialog()\"></button>\r\n\r\n<p-dialog [header] = \"'Adicionar ' + selectedDocument.label\" [(visible)]=\"visible\" [modal]=\"true\" [style]=\"{ width: '30rem' }\" [breakpoints]=\"{ '1199px': '75vw', '575px': '90vw' }\"\r\nposition = \"top\" [closable]=\"true\" (onHide)=\"visible=false\">\r\n <div class=\"mt-3\">\r\n <div class=\"text-center\">\r\n <input #fileInput type=\"file\" (change)=\"fileChange($event)\" class=\"hidden\"\r\n placeholder=\"Upload file\" [attr.accept]=\"acceptedFileTypes\" multiple>\r\n </div>\r\n <div class=\"text-center\">\r\n <p-button\r\n icon=\"pi pi-upload\"\r\n (click)=\"loadFileClick()\"\r\n [text] = \"true\"\r\n [rounded]=\"true\"\r\n ></p-button>\r\n\r\n <!-- <label *ngIf=\"isMobile\" (click)=\"openModal2(scanContent)\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">camera_alt</mat-icon>\r\n </label> -->\r\n </div>\r\n </div>\r\n</p-dialog>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i1$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }] });
183
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: UploadDialogComponent, isStandalone: true, selector: "lib-upload-dialog", inputs: { selectedDocument: "selectedDocument", allowedExtensions: "allowedExtensions" }, outputs: { onUploaded: "onUploaded", loadFile: "loadFile" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true, static: true }], ngImport: i0, template: "<input\r\n #fileInput\r\n type=\"file\"\r\n (change)=\"fileChange($event)\"\r\n class=\"hidden\"\r\n placeholder=\"Upload file\"\r\n [attr.accept]=\"acceptedFileTypes\"\r\n multiple\r\n/>\r\n<button\r\n pButton\r\n type=\"button\"\r\n label=\"Subir archivo\"\r\n icon=\"pi pi-upload\"\r\n class=\"p-button-outlined ff-btn-upload\"\r\n (click)=\"loadFileClick()\"\r\n></button>\r\n\r\n<!-- <p-dialog [header] = \"'Adicionar ' + selectedDocument.label\" [(visible)]=\"visible\" [modal]=\"true\" [style]=\"{ width: '30rem' }\" [breakpoints]=\"{ '1199px': '75vw', '575px': '90vw' }\"\r\nposition = \"top\" [closable]=\"true\" (onHide)=\"visible=false\">\r\n <div class=\"mt-3\">\r\n <div class=\"text-center\">\r\n <input #fileInput type=\"file\" (change)=\"fileChange($event)\" class=\"hidden\"\r\n placeholder=\"Upload file\" [attr.accept]=\"acceptedFileTypes\" multiple>\r\n </div>\r\n <div class=\"text-center\">\r\n <p-button\r\n icon=\"pi pi-upload\"\r\n (click)=\"loadFileClick()\"\r\n [text] = \"true\"\r\n [rounded]=\"true\"\r\n ></p-button>\r\n\r\n <label *ngIf=\"isMobile\" (click)=\"openModal2(scanContent)\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">camera_alt</mat-icon>\r\n </label> \r\n </div>\r\n </div>\r\n</p-dialog> -->\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: DialogModule }] });
134
184
  }
135
185
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: UploadDialogComponent, decorators: [{
136
186
  type: Component,
137
- args: [{ selector: 'lib-upload-dialog', imports: [CommonModule, ButtonModule, DialogModule], template: "<button pButton type=\"button\" label=\"Subir archivo\" icon=\"pi pi-upload\"\r\n class=\"p-button-outlined ff-btn-upload\"\r\n (click)=\"showDialog()\"></button>\r\n\r\n<p-dialog [header] = \"'Adicionar ' + selectedDocument.label\" [(visible)]=\"visible\" [modal]=\"true\" [style]=\"{ width: '30rem' }\" [breakpoints]=\"{ '1199px': '75vw', '575px': '90vw' }\"\r\nposition = \"top\" [closable]=\"true\" (onHide)=\"visible=false\">\r\n <div class=\"mt-3\">\r\n <div class=\"text-center\">\r\n <input #fileInput type=\"file\" (change)=\"fileChange($event)\" class=\"hidden\"\r\n placeholder=\"Upload file\" [attr.accept]=\"acceptedFileTypes\" multiple>\r\n </div>\r\n <div class=\"text-center\">\r\n <p-button\r\n icon=\"pi pi-upload\"\r\n (click)=\"loadFileClick()\"\r\n [text] = \"true\"\r\n [rounded]=\"true\"\r\n ></p-button>\r\n\r\n <!-- <label *ngIf=\"isMobile\" (click)=\"openModal2(scanContent)\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">camera_alt</mat-icon>\r\n </label> -->\r\n </div>\r\n </div>\r\n</p-dialog>\r\n" }]
187
+ args: [{ selector: 'lib-upload-dialog', imports: [CommonModule, ButtonModule, DialogModule], template: "<input\r\n #fileInput\r\n type=\"file\"\r\n (change)=\"fileChange($event)\"\r\n class=\"hidden\"\r\n placeholder=\"Upload file\"\r\n [attr.accept]=\"acceptedFileTypes\"\r\n multiple\r\n/>\r\n<button\r\n pButton\r\n type=\"button\"\r\n label=\"Subir archivo\"\r\n icon=\"pi pi-upload\"\r\n class=\"p-button-outlined ff-btn-upload\"\r\n (click)=\"loadFileClick()\"\r\n></button>\r\n\r\n<!-- <p-dialog [header] = \"'Adicionar ' + selectedDocument.label\" [(visible)]=\"visible\" [modal]=\"true\" [style]=\"{ width: '30rem' }\" [breakpoints]=\"{ '1199px': '75vw', '575px': '90vw' }\"\r\nposition = \"top\" [closable]=\"true\" (onHide)=\"visible=false\">\r\n <div class=\"mt-3\">\r\n <div class=\"text-center\">\r\n <input #fileInput type=\"file\" (change)=\"fileChange($event)\" class=\"hidden\"\r\n placeholder=\"Upload file\" [attr.accept]=\"acceptedFileTypes\" multiple>\r\n </div>\r\n <div class=\"text-center\">\r\n <p-button\r\n icon=\"pi pi-upload\"\r\n (click)=\"loadFileClick()\"\r\n [text] = \"true\"\r\n [rounded]=\"true\"\r\n ></p-button>\r\n\r\n <label *ngIf=\"isMobile\" (click)=\"openModal2(scanContent)\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">camera_alt</mat-icon>\r\n </label> \r\n </div>\r\n </div>\r\n</p-dialog> -->\r\n" }]
138
188
  }], ctorParameters: () => [], propDecorators: { selectedDocument: [{
139
189
  type: Input
190
+ }], allowedExtensions: [{
191
+ type: Input
140
192
  }], onUploaded: [{
141
193
  type: Output
142
194
  }], loadFile: [{
@@ -147,6 +199,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
147
199
  }] } });
148
200
 
149
201
  // flexible-date.pipe.ts
202
+ registerLocaleData(localeEs);
150
203
  class FlexibleDatePipe {
151
204
  datePipe = new DatePipe('es'); // o el locale que uses
152
205
  transform(value, format = 'dd/MM/yyyy HH:mm') {
@@ -203,7 +256,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
203
256
  }] });
204
257
 
205
258
  class FolderFilesComponent {
206
- documentService;
207
259
  documentsService = inject(DOCUMENT_SERVICE);
208
260
  searchSubject = new Subject();
209
261
  destroy$ = new Subject();
@@ -215,11 +267,11 @@ class FolderFilesComponent {
215
267
  requestData;
216
268
  useBreadcrumb = false;
217
269
  usesApi = true;
270
+ /** Extensiones permitidas para subir (ej. ['.pdf', '.xlsx']). Si no se define, usa el default de la librería. */
271
+ allowedUploadTypes;
218
272
  onFileChange = new EventEmitter();
219
273
  onCargarArchivo = new EventEmitter();
220
274
  onEliminarMasivo = new EventEmitter();
221
- onOpenVisorDoc = new EventEmitter();
222
- onOpenNewWindow = new EventEmitter();
223
275
  onBack = new EventEmitter();
224
276
  items = [];
225
277
  page = 1;
@@ -235,11 +287,15 @@ class FolderFilesComponent {
235
287
  pageSizeOptions = [
236
288
  { label: '5/pág', value: 5 },
237
289
  { label: '10/pág', value: 10 },
238
- { label: '20/pág', value: 20 }
290
+ { label: '20/pág', value: 20 },
239
291
  ];
240
- constructor(documentService) {
241
- this.documentService = documentService;
242
- this.searchSubject.pipe(debounceTime(400), distinctUntilChanged(), takeUntil(this.destroy$)).subscribe(() => {
292
+ current_path = '';
293
+ current_label = '';
294
+ displayView = false;
295
+ constructor() {
296
+ this.searchSubject
297
+ .pipe(debounceTime(400), distinctUntilChanged(), takeUntil(this.destroy$))
298
+ .subscribe(() => {
243
299
  this.page = 1;
244
300
  if (this.usesApi) {
245
301
  this.loadFiles();
@@ -259,6 +315,9 @@ class FolderFilesComponent {
259
315
  this.destroy$.complete();
260
316
  }
261
317
  ngOnChanges(changes) {
318
+ this.current_path = '';
319
+ this.current_label = '';
320
+ this.displayView = false;
262
321
  if (changes['carpeta'] && this.carpeta) {
263
322
  this.init();
264
323
  }
@@ -287,23 +346,33 @@ class FolderFilesComponent {
287
346
  if (this.carpeta?.reglas && typeof this.carpeta.reglas === 'string') {
288
347
  this.carpeta.reglas = JSON.parse(this.carpeta.reglas);
289
348
  }
290
- if (!this.carpeta?.reglas?.permisos?.subestados && this.carpeta?.reglas?.permisos) {
291
- this.carpeta.reglas.permisos.cargarFront = this.carpeta.reglas.permisos.cargar;
292
- this.carpeta.reglas.permisos.borrarFront = this.carpeta.reglas.permisos.borrar;
349
+ if (!this.carpeta?.reglas?.permisos?.subestados &&
350
+ this.carpeta?.reglas?.permisos) {
351
+ this.carpeta.reglas.permisos.cargarFront =
352
+ this.carpeta.reglas.permisos.cargar;
353
+ this.carpeta.reglas.permisos.borrarFront =
354
+ this.carpeta.reglas.permisos.borrar;
293
355
  }
294
- else if (this.carpeta?.reglas?.permisos?.subestados && this.subestado?.trim()) {
356
+ else if (this.carpeta?.reglas?.permisos?.subestados &&
357
+ this.subestado?.trim()) {
295
358
  const sub = this.subestado.toLowerCase().trim();
296
359
  this.carpeta.reglas.permisos.cargarFront = Array.isArray(this.carpeta.reglas.permisos.subestados.cargar)
297
- ? this.carpeta.reglas.permisos.subestados.cargar.map((c) => c.toLowerCase().trim()).includes(sub)
360
+ ? this.carpeta.reglas.permisos.subestados.cargar
361
+ .map((c) => c.toLowerCase().trim())
362
+ .includes(sub)
298
363
  : this.carpeta.reglas.permisos.cargar;
299
364
  this.carpeta.reglas.permisos.borrarFront = Array.isArray(this.carpeta.reglas.permisos.subestados.borrar)
300
- ? this.carpeta.reglas.permisos.subestados.borrar.map((b) => b.toLowerCase().trim()).includes(sub)
365
+ ? this.carpeta.reglas.permisos.subestados.borrar
366
+ .map((b) => b.toLowerCase().trim())
367
+ .includes(sub)
301
368
  : this.carpeta.reglas.permisos.borrar;
302
369
  }
303
370
  }
304
371
  loadFiles() {
305
372
  this.loading = true;
306
- this.documentsService.getFilesByFolder(this.idKatios, this.carpeta.NMCo, this.requestData, this.page, this.pageSize, this.searchQuery).subscribe({
373
+ this.documentsService
374
+ .getFilesByFolder(this.idKatios, this.carpeta.NMCo, this.requestData, this.page, this.pageSize, this.searchQuery)
375
+ .subscribe({
307
376
  next: (response) => {
308
377
  const res = response?.data ?? response;
309
378
  this.totalRecords = res.total ?? 0;
@@ -317,7 +386,7 @@ class FolderFilesComponent {
317
386
  error: (error) => {
318
387
  console.error('Error loading files by folder:', error);
319
388
  this.loading = false;
320
- }
389
+ },
321
390
  });
322
391
  }
323
392
  onPageChange(event) {
@@ -348,13 +417,26 @@ class FolderFilesComponent {
348
417
  this.onCargarArchivo.emit(this.carpeta);
349
418
  }
350
419
  openVisorDoc(item) {
351
- this.onOpenVisorDoc.emit(item);
420
+ if (this.carpeta.TipoArchivo == '1' && this.isMobile) {
421
+ //is mobile
422
+ cordova.InAppBrowser.open(item.Path, '_system', 'location=yes');
423
+ }
424
+ else {
425
+ this.current_path = item.Path;
426
+ this.current_label = item.label;
427
+ console.log('current_path', this.current_path);
428
+ this.displayView = true;
429
+ }
352
430
  }
353
- openNewWindow(item) {
354
- this.onOpenNewWindow.emit(item);
431
+ openCurrentInNewWindow(path) {
432
+ window.open(path || this.current_path, '_blank').focus();
355
433
  }
356
- isExcel(item) {
357
- return isExcelFileName(item?.label) || isExcelFileName(item?.Path);
434
+ canPreview(label, path) {
435
+ return (canPreviewFile(label || this.current_label) ||
436
+ canPreviewFile(path || this.current_path));
437
+ }
438
+ previewFallbackIcon(label, path) {
439
+ return getFileTypeIcon(label || this.current_label || path || this.current_path);
358
440
  }
359
441
  goBack() {
360
442
  this.onBack.emit();
@@ -363,13 +445,13 @@ class FolderFilesComponent {
363
445
  if (event.checked)
364
446
  this.docsEliminables.push(document);
365
447
  else
366
- this.docsEliminables = this.docsEliminables.filter(doc => doc !== document);
448
+ this.docsEliminables = this.docsEliminables.filter((doc) => doc !== document);
367
449
  }
368
450
  emitEliminarMasivo() {
369
451
  this.onEliminarMasivo.emit(this.docsEliminables);
370
452
  }
371
453
  toggleSelectAll() {
372
- this.items.forEach(item => (item.delete = this.allSelected));
454
+ this.items.forEach((item) => (item.delete = this.allSelected));
373
455
  this.docsEliminables = this.allSelected ? [...this.items] : [];
374
456
  }
375
457
  // refresh(): void {
@@ -382,17 +464,27 @@ class FolderFilesComponent {
382
464
  this.page = 1;
383
465
  this.loadFiles();
384
466
  }
385
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FolderFilesComponent, deps: [{ token: SfDocumentsService }], target: i0.ɵɵFactoryTarget.Component });
386
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: FolderFilesComponent, isStandalone: true, selector: "lib-folder-files", inputs: { carpeta: "carpeta", isMobile: "isMobile", idKatios: "idKatios", server: "server", subestado: "subestado", requestData: "requestData", useBreadcrumb: "useBreadcrumb", usesApi: "usesApi" }, outputs: { onFileChange: "onFileChange", onCargarArchivo: "onCargarArchivo", onEliminarMasivo: "onEliminarMasivo", onOpenVisorDoc: "onOpenVisorDoc", onOpenNewWindow: "onOpenNewWindow", onBack: "onBack" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"ff-layout\">\r\n <!-- Header fijo -->\r\n <div class=\"ff-header\">\r\n <div class=\"ff-back-row\" *ngIf=\"!useBreadcrumb\">\r\n <button pButton type=\"button\" icon=\"pi pi-arrow-left\" label=\"Volver\" (click)=\"goBack()\"></button>\r\n </div>\r\n\r\n <!-- Toolbar: b\u00FAsqueda + botones de acci\u00F3n -->\r\n <div class=\"ff-toolbar\">\r\n <p-iconfield class=\"ff-toolbar__search\">\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input type=\"text\" pInputText\r\n [placeholder]=\"'Buscar en ' + carpeta.label.replace('#toolbar=0&navpanes=0&statusbar=0','')\"\r\n [(ngModel)]=\"searchQuery\"\r\n (input)=\"onSearchInput()\"\r\n class=\"w-full\">\r\n </p-iconfield>\r\n\r\n <div class=\"ff-toolbar__actions\">\r\n <lib-upload-dialog *ngIf=\"carpeta?.reglas?.permisos?.cargarFront\"\r\n [selectedDocument]=\"carpeta\"\r\n (onUploaded)=\"fileChange($event)\"\r\n (loadFile)=\"cargarArchivo()\">\r\n </lib-upload-dialog>\r\n\r\n <button pButton type=\"button\"\r\n icon=\"pi pi-trash\"\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n (click)=\"emitEliminarMasivo()\"\r\n [disabled]=\"docsEliminables.length === 0\"\r\n class=\"p-button-outlined p-button-danger p-button-sm ff-btn-delete\">\r\n <span class=\"ff-btn-label\">Eliminar ({{docsEliminables.length}})</span>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <!-- Fila seleccionar todo / total archivos -->\r\n <div class=\"ff-select-row\" *ngIf=\"!loading && items.length > 0\">\r\n <div class=\"ff-select-row__left\">\r\n <p-checkbox *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"allSelected\"\r\n (onChange)=\"toggleSelectAll()\">\r\n </p-checkbox>\r\n <span *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\" class=\"ff-select-row__label\">Seleccionar todo</span>\r\n </div>\r\n <span class=\"ff-select-row__count\">{{totalRecords || items.length}} {{(totalRecords || items.length) === 1 ? 'archivo' : 'archivos'}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- Contenido scrollable -->\r\n <div class=\"ff-file-list-wrapper\">\r\n <!-- Loading -->\r\n <div *ngIf=\"loading\" class=\"ff-loading\">\r\n <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem;\"></i>\r\n </div>\r\n\r\n <!-- Lista de archivos -->\r\n <div class=\"ff-file-list\" *ngIf=\"!loading\">\r\n <div class=\"ff-file-item\" *ngFor=\"let item of items\" (click)=\"openVisorDoc(item)\">\r\n <p-checkbox *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"item.delete\"\r\n (onChange)=\"onClickedCheckDelete($event, item)\"\r\n (click)=\"$event.stopPropagation()\">\r\n </p-checkbox>\r\n\r\n <div class=\"ff-file-item__preview\">\r\n <i *ngIf=\"isExcel(item)\" class=\"pi pi-file-excel ff-file-item__frame ff-file-item__icon\"></i>\r\n <ng-container *ngIf=\"!isExcel(item)\">\r\n <embed *ngIf=\"carpeta.TipoArchivo == '2'\" class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\">\r\n <img *ngIf=\"carpeta.TipoArchivo == '1' && isMobile\" class=\"ff-file-item__frame\"\r\n src=\"https://macuna.tecfinanzas.com/Imagenes/pdf_icon.png\">\r\n <iframe *ngIf=\"carpeta.TipoArchivo == '1' && !isMobile\" class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\" frameborder=\"0\"></iframe>\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"ff-file-item__info\">\r\n <span class=\"ff-file-item__name\">{{item.label}}</span>\r\n <span class=\"ff-file-item__date\" *ngIf=\"item.FechaSubida && !isMobile\">Fecha Subida: {{item.FechaSubida | flexibleDate:'dd/MM/yyyy HH:mm'}}</span>\r\n <span class=\"ff-file-item__date\" *ngIf=\"item.FechaSubida && isMobile\">{{item.FechaSubida | flexibleDate:'dd/MM/yyyy HH:mm'}}</span>\r\n <i class=\"pi pi-external-link ff-file-item__open\"\r\n (click)=\"openNewWindow(item); $event.stopPropagation()\"\r\n role=\"button\" tabindex=\"0\"\r\n aria-label=\"Abrir en nueva ventana\"\r\n (keydown.enter)=\"openNewWindow(item); $event.stopPropagation()\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Sin resultados -->\r\n <div *ngIf=\"!loading && items.length === 0\" class=\"ff-empty\">\r\n Sin documentos cargados\r\n </div>\r\n </div>\r\n\r\n <!-- Footer fijo: paginaci\u00F3n compacta -->\r\n <div class=\"ff-footer\" *ngIf=\"usesApi && totalRecords > 0\">\r\n <div class=\"ff-pagination\">\r\n <p-select [options]=\"pageSizeOptions\" optionLabel=\"label\" optionValue=\"value\"\r\n [(ngModel)]=\"pageSize\" (ngModelChange)=\"onPageSizeChange()\">\r\n </p-select>\r\n <p-paginator\r\n [first]=\"first\"\r\n [rows]=\"pageSize\"\r\n [totalRecords]=\"totalRecords\"\r\n (onPageChange)=\"onPageChange($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [showPageLinks]=\"false\"\r\n [showFirstLastIcon]=\"false\">\r\n </p-paginator>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-header{flex-shrink:0}.ff-back-row{display:flex;margin-block:15px}.ff-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:4px;padding:.5rem}.ff-toolbar__search{flex:1;min-width:0}:host ::ng-deep .ff-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.ff-toolbar__actions{display:flex;align-items:center;gap:6px;flex-shrink:0}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px;padding:.4rem .75rem}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .ff-btn-delete{white-space:nowrap;font-size:13px;padding:.4rem .75rem}.ff-select-row{display:flex;align-items:center;justify-content:space-between;padding:8px 4px;border-bottom:1px solid #e5e7eb;padding:.5rem}.ff-select-row__left{display:flex;align-items:center;gap:8px}.ff-select-row__label{font-size:13px;color:#374151}.ff-select-row__count{font-size:13px;color:#6b7280}.ff-file-list-wrapper{flex:1;min-height:0;overflow-y:auto}.ff-loading{text-align:center;padding:20px}.ff-file-list{display:flex;flex-direction:column}.ff-file-item{display:flex;align-items:center;gap:12px;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.ff-file-item:hover{background-color:#f9fafb}.ff-file-item__preview{flex-shrink:0;width:85px;height:100px;overflow:hidden;display:flex;align-items:center;justify-content:center}.ff-file-item__frame{width:85px;height:100px;border:none;pointer-events:none;object-fit:cover}.ff-file-item__icon{display:flex;align-items:center;justify-content:center;font-size:40px;color:#1d6f42;background-color:#f0faf5;border-radius:4px}.ff-file-item__info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;text-align:right}.ff-file-item__name{font-size:13px;font-weight:500;color:#111827;min-width:0;word-break:break-word}.ff-file-item__date{font-size:12px;color:#9ca3af;overflow:hidden}.ff-file-item__open{font-size:18px;color:#3b82f6;flex-shrink:0;padding:4px;border-radius:4px;transition:color .15s ease,background-color .15s ease;cursor:pointer;align-self:flex-end}.ff-file-item__open:hover{color:#2563eb;background-color:#eff6ff}.ff-empty{text-align:center;padding:20px;color:#999}.ff-footer{flex-shrink:0;border-top:1px solid #e5e7eb}.ff-pagination{display:flex;align-items:center;justify-content:flex-end;gap:4px;padding:6px 8px;font-size:13px}:host ::ng-deep .ff-pagination .p-select{width:auto;min-width:90px}:host ::ng-deep .ff-pagination .p-select .p-select-label{font-size:12px;padding:4px 8px}:host ::ng-deep .ff-pagination .p-paginator{padding:0;background:transparent;border:none;gap:0}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-current{font-size:12px;color:#6b7280;padding:0 6px;min-width:auto;height:auto}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-prev,:host ::ng-deep .ff-pagination .p-paginator .p-paginator-next{min-width:28px;height:28px;font-size:12px}@media only screen and (max-width: 656px){.ff-toolbar{gap:6px}.ff-btn-label{display:none}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button .p-button-label{display:none}:host ::ng-deep .ff-toolbar__actions .p-button{padding:.5rem}.ff-file-item__preview,.ff-file-item__frame{width:65px;height:80px}.ff-file-item__icon{font-size:28px}.ff-file-item__name{font-size:12px}.ff-file-item__date{font-size:11px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i5.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i6.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: PaginatorModule }, { kind: "component", type: i7.Paginator, selector: "p-paginator", inputs: ["pageLinkSize", "style", "styleClass", "alwaysShow", "dropdownAppendTo", "templateLeft", "templateRight", "appendTo", "dropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showFirstLastIcon", "totalRecords", "rows", "rowsPerPageOptions", "showJumpToPageDropdown", "showJumpToPageInput", "jumpToPageItemTemplate", "showPageLinks", "locale", "dropdownItemTemplate", "first"], outputs: ["onPageChange"] }, { kind: "pipe", type: SafePipe, name: "safe" }, { kind: "component", type: UploadDialogComponent, selector: "lib-upload-dialog", inputs: ["selectedDocument"], outputs: ["onUploaded", "loadFile"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i8.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "pipe", type: FlexibleDatePipe, name: "flexibleDate" }] });
467
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FolderFilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
468
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.20", type: FolderFilesComponent, isStandalone: true, selector: "lib-folder-files", inputs: { carpeta: "carpeta", isMobile: "isMobile", idKatios: "idKatios", server: "server", subestado: "subestado", requestData: "requestData", useBreadcrumb: "useBreadcrumb", usesApi: "usesApi", allowedUploadTypes: "allowedUploadTypes" }, outputs: { onFileChange: "onFileChange", onCargarArchivo: "onCargarArchivo", onEliminarMasivo: "onEliminarMasivo", onBack: "onBack" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"ff-layout\">\r\n <!-- Header fijo -->\r\n <div class=\"ff-header\">\r\n <div class=\"ff-back-row\" *ngIf=\"!useBreadcrumb\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n icon=\"pi pi-arrow-left\"\r\n label=\"Volver\"\r\n (click)=\"goBack()\"\r\n ></button>\r\n </div>\r\n\r\n <!-- Toolbar: b\u00FAsqueda + botones de acci\u00F3n -->\r\n <div class=\"ff-toolbar\">\r\n <p-iconfield class=\"ff-toolbar__search\">\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input\r\n type=\"text\"\r\n pInputText\r\n [placeholder]=\"\r\n 'Buscar en ' +\r\n carpeta.label.replace('#toolbar=0&navpanes=0&statusbar=0', '')\r\n \"\r\n [(ngModel)]=\"searchQuery\"\r\n (input)=\"onSearchInput()\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n\r\n <div class=\"ff-toolbar__actions\">\r\n <lib-upload-dialog\r\n *ngIf=\"carpeta?.reglas?.permisos?.cargarFront\"\r\n [selectedDocument]=\"carpeta\"\r\n [allowedExtensions]=\"allowedUploadTypes\"\r\n (onUploaded)=\"fileChange($event)\"\r\n (loadFile)=\"cargarArchivo()\"\r\n >\r\n </lib-upload-dialog>\r\n\r\n <button\r\n pButton\r\n type=\"button\"\r\n icon=\"pi pi-trash\"\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n (click)=\"emitEliminarMasivo()\"\r\n [disabled]=\"docsEliminables.length === 0\"\r\n class=\"p-button-outlined p-button-danger p-button-sm ff-btn-delete\"\r\n >\r\n <span class=\"ff-btn-label\"\r\n >Eliminar ({{ docsEliminables.length }})</span\r\n >\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <!-- Fila seleccionar todo / total archivos -->\r\n <div class=\"ff-select-row\" *ngIf=\"!loading && items.length > 0\">\r\n <div class=\"ff-select-row__left\">\r\n <p-checkbox\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"allSelected\"\r\n (onChange)=\"toggleSelectAll()\"\r\n >\r\n </p-checkbox>\r\n <span\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n class=\"ff-select-row__label\"\r\n >Seleccionar todo</span\r\n >\r\n </div>\r\n <span class=\"ff-select-row__count\"\r\n >{{ totalRecords || items.length }}\r\n {{\r\n (totalRecords || items.length) === 1 ? \"archivo\" : \"archivos\"\r\n }}</span\r\n >\r\n </div>\r\n </div>\r\n\r\n <!-- Contenido scrollable -->\r\n <div class=\"ff-file-list-wrapper\">\r\n <!-- Loading -->\r\n <div *ngIf=\"loading\" class=\"ff-loading\">\r\n <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem\"></i>\r\n </div>\r\n\r\n <!-- Lista de archivos -->\r\n <div class=\"ff-file-list\" *ngIf=\"!loading\">\r\n <div\r\n class=\"ff-file-item\"\r\n *ngFor=\"let item of items\"\r\n (click)=\"openVisorDoc(item)\"\r\n >\r\n <p-checkbox\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"item.delete\"\r\n (onChange)=\"onClickedCheckDelete($event, item)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n </p-checkbox>\r\n\r\n <div class=\"ff-file-item__preview\">\r\n <i\r\n *ngIf=\"!canPreview(item.label, item.Path)\"\r\n class=\"pi ff-file-item__frame ff-file-item__icon\"\r\n [ngClass]=\"previewFallbackIcon(item.label, item.Path)\"\r\n ></i>\r\n <ng-container *ngIf=\"canPreview(item.label, item.Path)\">\r\n <embed\r\n *ngIf=\"carpeta.TipoArchivo == '2'\"\r\n class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\"\r\n />\r\n <img\r\n *ngIf=\"carpeta.TipoArchivo == '1' && isMobile\"\r\n class=\"ff-file-item__frame\"\r\n src=\"https://macuna.tecfinanzas.com/Imagenes/pdf_icon.png\"\r\n />\r\n <iframe\r\n *ngIf=\"carpeta.TipoArchivo == '1' && !isMobile\"\r\n class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\"\r\n frameborder=\"0\"\r\n ></iframe>\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"ff-file-item__info\">\r\n <span class=\"ff-file-item__name\">{{ item.label }}</span>\r\n <span class=\"ff-file-item__date\" *ngIf=\"item.FechaSubida && !isMobile\"\r\n >Fecha Subida:\r\n {{ item.FechaSubida | flexibleDate: \"dd/MM/yyyy HH:mm\" }}</span\r\n >\r\n <span\r\n class=\"ff-file-item__date\"\r\n *ngIf=\"item.FechaSubida && isMobile\"\r\n >{{ item.FechaSubida | flexibleDate: \"dd/MM/yyyy HH:mm\" }}</span\r\n >\r\n <i\r\n class=\"pi pi-external-link ff-file-item__open\"\r\n (click)=\"\r\n openCurrentInNewWindow(item.Path); $event.stopPropagation()\r\n \"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n aria-label=\"Abrir en nueva ventana\"\r\n (keydown.enter)=\"\r\n openCurrentInNewWindow(item.Path); $event.stopPropagation()\r\n \"\r\n ></i>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Sin resultados -->\r\n <div *ngIf=\"!loading && items.length === 0\" class=\"ff-empty\">\r\n Sin documentos cargados\r\n </div>\r\n </div>\r\n\r\n <!-- Footer fijo: paginaci\u00F3n compacta -->\r\n <div class=\"ff-footer\" *ngIf=\"usesApi && totalRecords > 0\">\r\n <div class=\"ff-pagination\">\r\n <p-select\r\n [options]=\"pageSizeOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [(ngModel)]=\"pageSize\"\r\n (ngModelChange)=\"onPageSizeChange()\"\r\n >\r\n </p-select>\r\n <p-paginator\r\n [first]=\"first\"\r\n [rows]=\"pageSize\"\r\n [totalRecords]=\"totalRecords\"\r\n (onPageChange)=\"onPageChange($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [showPageLinks]=\"false\"\r\n [showFirstLastIcon]=\"false\"\r\n >\r\n </p-paginator>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<p-dialog\r\n [(visible)]=\"displayView\"\r\n [header]=\"current_label.replace('#toolbar=0&navpanes=0&statusbar=0', '')\"\r\n [modal]=\"true\"\r\n [style]=\"{ width: '70vw' }\"\r\n>\r\n <div *ngIf=\"!canPreview()\" class=\"sf-doc-preview-fallback\">\r\n <i class=\"pi\" [ngClass]=\"previewFallbackIcon()\"></i>\r\n <p>La vista previa no est\u00E1 disponible para este tipo de archivo.</p>\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Abrir en una nueva ventana\"\r\n icon=\"pi pi-external-link\"\r\n (click)=\"openCurrentInNewWindow()\"\r\n ></button>\r\n </div>\r\n <ng-container *ngIf=\"canPreview()\">\r\n <embed\r\n *ngIf=\"carpeta.TipoArchivo == '2'\"\r\n [src]=\"current_path | safe\"\r\n style=\"width: 100%; min-height: 600px\"\r\n />\r\n <iframe\r\n *ngIf=\"carpeta.TipoArchivo == '1'\"\r\n style=\"width: 100%; min-height: 600px\"\r\n [src]=\"current_path | safe\"\r\n ></iframe>\r\n </ng-container>\r\n</p-dialog>\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-header{flex-shrink:0}.ff-back-row{display:flex;margin-block:15px}.ff-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:4px;padding:.5rem}.ff-toolbar__search{flex:1;min-width:0}:host ::ng-deep .ff-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.ff-toolbar__actions{display:flex;align-items:center;gap:6px;flex-shrink:0}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px;padding:.4rem .75rem}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .ff-btn-delete{white-space:nowrap;font-size:13px;padding:.4rem .75rem}.ff-select-row{display:flex;align-items:center;justify-content:space-between;padding:8px 4px;border-bottom:1px solid #e5e7eb;padding:.5rem}.ff-select-row__left{display:flex;align-items:center;gap:8px}.ff-select-row__label{font-size:13px;color:#374151}.ff-select-row__count{font-size:13px;color:#6b7280}.ff-file-list-wrapper{flex:1;min-height:0;overflow-y:auto}.ff-loading{text-align:center;padding:20px}.ff-file-list{display:flex;flex-direction:column}.ff-file-item{display:flex;align-items:center;gap:12px;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.ff-file-item:hover{background-color:#f9fafb}.ff-file-item__preview{flex-shrink:0;width:85px;height:100px;overflow:hidden;display:flex;align-items:center;justify-content:center}.ff-file-item__frame{width:85px;height:100px;border:none;pointer-events:none;object-fit:cover}.ff-file-item__icon{display:flex;align-items:center;justify-content:center;font-size:40px;color:#6b7280;background-color:#f3f4f6;border-radius:4px}.ff-file-item__icon.pi-file-excel{color:#1d6f42;background-color:#f0faf5}.ff-file-item__icon.pi-file-pdf{color:#b91c1c;background-color:#fef2f2}.ff-file-item__icon.pi-file-word{color:#1d4ed8;background-color:#eff6ff}.ff-file-item__info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;text-align:right}.ff-file-item__name{font-size:13px;font-weight:500;color:#111827;min-width:0;word-break:break-word}.ff-file-item__date{font-size:12px;color:#9ca3af;overflow:hidden}.ff-file-item__open{font-size:18px;color:#3b82f6;flex-shrink:0;padding:4px;border-radius:4px;transition:color .15s ease,background-color .15s ease;cursor:pointer;align-self:flex-end}.ff-file-item__open:hover{color:#2563eb;background-color:#eff6ff}.ff-empty{text-align:center;padding:20px;color:#999}.ff-footer{flex-shrink:0;border-top:1px solid #e5e7eb}.ff-pagination{display:flex;align-items:center;justify-content:flex-end;gap:4px;padding:6px 8px;font-size:13px}:host ::ng-deep .ff-pagination .p-select{width:auto;min-width:90px}:host ::ng-deep .ff-pagination .p-select .p-select-label{font-size:12px;padding:4px 8px}:host ::ng-deep .ff-pagination .p-paginator{padding:0;background:transparent;border:none;gap:0}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-current{font-size:12px;color:#6b7280;padding:0 6px;min-width:auto;height:auto}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-prev,:host ::ng-deep .ff-pagination .p-paginator .p-paginator-next{min-width:28px;height:28px;font-size:12px}@media only screen and (max-width: 656px){.ff-toolbar{gap:6px}.ff-btn-label{display:none}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button .p-button-label{display:none}:host ::ng-deep .ff-toolbar__actions .p-button{padding:.5rem}.ff-file-item__preview,.ff-file-item__frame{width:65px;height:80px}.ff-file-item__icon{font-size:28px}.ff-file-item__name{font-size:12px}.ff-file-item__date{font-size:11px}}.sf-doc-preview-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:300px;text-align:center;color:#374151}.sf-doc-preview-fallback i{font-size:48px;color:#6b7280}.sf-doc-preview-fallback i.pi-file-excel{color:#1d6f42}.sf-doc-preview-fallback i.pi-file-pdf{color:#b91c1c}.sf-doc-preview-fallback i.pi-file-word{color:#1d4ed8}.frameDoc{overflow:hidden;border:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: PaginatorModule }, { kind: "component", type: i6.Paginator, selector: "p-paginator", inputs: ["pageLinkSize", "style", "styleClass", "alwaysShow", "dropdownAppendTo", "templateLeft", "templateRight", "appendTo", "dropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showFirstLastIcon", "totalRecords", "rows", "rowsPerPageOptions", "showJumpToPageDropdown", "showJumpToPageInput", "jumpToPageItemTemplate", "showPageLinks", "locale", "dropdownItemTemplate", "first"], outputs: ["onPageChange"] }, { kind: "pipe", type: SafePipe, name: "safe" }, { kind: "component", type: UploadDialogComponent, selector: "lib-upload-dialog", inputs: ["selectedDocument", "allowedExtensions"], outputs: ["onUploaded", "loadFile"] }, { kind: "ngmodule", type: SelectModule }, { kind: "component", type: i7.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "size", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "pipe", type: FlexibleDatePipe, name: "flexibleDate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i8.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }] });
387
469
  }
388
470
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FolderFilesComponent, decorators: [{
389
471
  type: Component,
390
472
  args: [{ selector: 'lib-folder-files', imports: [
391
- CommonModule, FormsModule, ButtonModule,
392
- CheckboxModule, InputTextModule, InputIcon, IconField,
393
- PaginatorModule, SafePipe, UploadDialogComponent, SelectModule, FlexibleDatePipe
394
- ], standalone: true, template: "<div class=\"ff-layout\">\r\n <!-- Header fijo -->\r\n <div class=\"ff-header\">\r\n <div class=\"ff-back-row\" *ngIf=\"!useBreadcrumb\">\r\n <button pButton type=\"button\" icon=\"pi pi-arrow-left\" label=\"Volver\" (click)=\"goBack()\"></button>\r\n </div>\r\n\r\n <!-- Toolbar: b\u00FAsqueda + botones de acci\u00F3n -->\r\n <div class=\"ff-toolbar\">\r\n <p-iconfield class=\"ff-toolbar__search\">\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input type=\"text\" pInputText\r\n [placeholder]=\"'Buscar en ' + carpeta.label.replace('#toolbar=0&navpanes=0&statusbar=0','')\"\r\n [(ngModel)]=\"searchQuery\"\r\n (input)=\"onSearchInput()\"\r\n class=\"w-full\">\r\n </p-iconfield>\r\n\r\n <div class=\"ff-toolbar__actions\">\r\n <lib-upload-dialog *ngIf=\"carpeta?.reglas?.permisos?.cargarFront\"\r\n [selectedDocument]=\"carpeta\"\r\n (onUploaded)=\"fileChange($event)\"\r\n (loadFile)=\"cargarArchivo()\">\r\n </lib-upload-dialog>\r\n\r\n <button pButton type=\"button\"\r\n icon=\"pi pi-trash\"\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n (click)=\"emitEliminarMasivo()\"\r\n [disabled]=\"docsEliminables.length === 0\"\r\n class=\"p-button-outlined p-button-danger p-button-sm ff-btn-delete\">\r\n <span class=\"ff-btn-label\">Eliminar ({{docsEliminables.length}})</span>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <!-- Fila seleccionar todo / total archivos -->\r\n <div class=\"ff-select-row\" *ngIf=\"!loading && items.length > 0\">\r\n <div class=\"ff-select-row__left\">\r\n <p-checkbox *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"allSelected\"\r\n (onChange)=\"toggleSelectAll()\">\r\n </p-checkbox>\r\n <span *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\" class=\"ff-select-row__label\">Seleccionar todo</span>\r\n </div>\r\n <span class=\"ff-select-row__count\">{{totalRecords || items.length}} {{(totalRecords || items.length) === 1 ? 'archivo' : 'archivos'}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- Contenido scrollable -->\r\n <div class=\"ff-file-list-wrapper\">\r\n <!-- Loading -->\r\n <div *ngIf=\"loading\" class=\"ff-loading\">\r\n <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem;\"></i>\r\n </div>\r\n\r\n <!-- Lista de archivos -->\r\n <div class=\"ff-file-list\" *ngIf=\"!loading\">\r\n <div class=\"ff-file-item\" *ngFor=\"let item of items\" (click)=\"openVisorDoc(item)\">\r\n <p-checkbox *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"item.delete\"\r\n (onChange)=\"onClickedCheckDelete($event, item)\"\r\n (click)=\"$event.stopPropagation()\">\r\n </p-checkbox>\r\n\r\n <div class=\"ff-file-item__preview\">\r\n <i *ngIf=\"isExcel(item)\" class=\"pi pi-file-excel ff-file-item__frame ff-file-item__icon\"></i>\r\n <ng-container *ngIf=\"!isExcel(item)\">\r\n <embed *ngIf=\"carpeta.TipoArchivo == '2'\" class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\">\r\n <img *ngIf=\"carpeta.TipoArchivo == '1' && isMobile\" class=\"ff-file-item__frame\"\r\n src=\"https://macuna.tecfinanzas.com/Imagenes/pdf_icon.png\">\r\n <iframe *ngIf=\"carpeta.TipoArchivo == '1' && !isMobile\" class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\" frameborder=\"0\"></iframe>\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"ff-file-item__info\">\r\n <span class=\"ff-file-item__name\">{{item.label}}</span>\r\n <span class=\"ff-file-item__date\" *ngIf=\"item.FechaSubida && !isMobile\">Fecha Subida: {{item.FechaSubida | flexibleDate:'dd/MM/yyyy HH:mm'}}</span>\r\n <span class=\"ff-file-item__date\" *ngIf=\"item.FechaSubida && isMobile\">{{item.FechaSubida | flexibleDate:'dd/MM/yyyy HH:mm'}}</span>\r\n <i class=\"pi pi-external-link ff-file-item__open\"\r\n (click)=\"openNewWindow(item); $event.stopPropagation()\"\r\n role=\"button\" tabindex=\"0\"\r\n aria-label=\"Abrir en nueva ventana\"\r\n (keydown.enter)=\"openNewWindow(item); $event.stopPropagation()\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Sin resultados -->\r\n <div *ngIf=\"!loading && items.length === 0\" class=\"ff-empty\">\r\n Sin documentos cargados\r\n </div>\r\n </div>\r\n\r\n <!-- Footer fijo: paginaci\u00F3n compacta -->\r\n <div class=\"ff-footer\" *ngIf=\"usesApi && totalRecords > 0\">\r\n <div class=\"ff-pagination\">\r\n <p-select [options]=\"pageSizeOptions\" optionLabel=\"label\" optionValue=\"value\"\r\n [(ngModel)]=\"pageSize\" (ngModelChange)=\"onPageSizeChange()\">\r\n </p-select>\r\n <p-paginator\r\n [first]=\"first\"\r\n [rows]=\"pageSize\"\r\n [totalRecords]=\"totalRecords\"\r\n (onPageChange)=\"onPageChange($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [showPageLinks]=\"false\"\r\n [showFirstLastIcon]=\"false\">\r\n </p-paginator>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-header{flex-shrink:0}.ff-back-row{display:flex;margin-block:15px}.ff-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:4px;padding:.5rem}.ff-toolbar__search{flex:1;min-width:0}:host ::ng-deep .ff-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.ff-toolbar__actions{display:flex;align-items:center;gap:6px;flex-shrink:0}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px;padding:.4rem .75rem}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .ff-btn-delete{white-space:nowrap;font-size:13px;padding:.4rem .75rem}.ff-select-row{display:flex;align-items:center;justify-content:space-between;padding:8px 4px;border-bottom:1px solid #e5e7eb;padding:.5rem}.ff-select-row__left{display:flex;align-items:center;gap:8px}.ff-select-row__label{font-size:13px;color:#374151}.ff-select-row__count{font-size:13px;color:#6b7280}.ff-file-list-wrapper{flex:1;min-height:0;overflow-y:auto}.ff-loading{text-align:center;padding:20px}.ff-file-list{display:flex;flex-direction:column}.ff-file-item{display:flex;align-items:center;gap:12px;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.ff-file-item:hover{background-color:#f9fafb}.ff-file-item__preview{flex-shrink:0;width:85px;height:100px;overflow:hidden;display:flex;align-items:center;justify-content:center}.ff-file-item__frame{width:85px;height:100px;border:none;pointer-events:none;object-fit:cover}.ff-file-item__icon{display:flex;align-items:center;justify-content:center;font-size:40px;color:#1d6f42;background-color:#f0faf5;border-radius:4px}.ff-file-item__info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;text-align:right}.ff-file-item__name{font-size:13px;font-weight:500;color:#111827;min-width:0;word-break:break-word}.ff-file-item__date{font-size:12px;color:#9ca3af;overflow:hidden}.ff-file-item__open{font-size:18px;color:#3b82f6;flex-shrink:0;padding:4px;border-radius:4px;transition:color .15s ease,background-color .15s ease;cursor:pointer;align-self:flex-end}.ff-file-item__open:hover{color:#2563eb;background-color:#eff6ff}.ff-empty{text-align:center;padding:20px;color:#999}.ff-footer{flex-shrink:0;border-top:1px solid #e5e7eb}.ff-pagination{display:flex;align-items:center;justify-content:flex-end;gap:4px;padding:6px 8px;font-size:13px}:host ::ng-deep .ff-pagination .p-select{width:auto;min-width:90px}:host ::ng-deep .ff-pagination .p-select .p-select-label{font-size:12px;padding:4px 8px}:host ::ng-deep .ff-pagination .p-paginator{padding:0;background:transparent;border:none;gap:0}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-current{font-size:12px;color:#6b7280;padding:0 6px;min-width:auto;height:auto}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-prev,:host ::ng-deep .ff-pagination .p-paginator .p-paginator-next{min-width:28px;height:28px;font-size:12px}@media only screen and (max-width: 656px){.ff-toolbar{gap:6px}.ff-btn-label{display:none}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button .p-button-label{display:none}:host ::ng-deep .ff-toolbar__actions .p-button{padding:.5rem}.ff-file-item__preview,.ff-file-item__frame{width:65px;height:80px}.ff-file-item__icon{font-size:28px}.ff-file-item__name{font-size:12px}.ff-file-item__date{font-size:11px}}\n"] }]
395
- }], ctorParameters: () => [{ type: SfDocumentsService }], propDecorators: { carpeta: [{
473
+ CommonModule,
474
+ FormsModule,
475
+ ButtonModule,
476
+ CheckboxModule,
477
+ InputTextModule,
478
+ InputIcon,
479
+ IconField,
480
+ PaginatorModule,
481
+ SafePipe,
482
+ UploadDialogComponent,
483
+ SelectModule,
484
+ FlexibleDatePipe,
485
+ DialogModule,
486
+ ], standalone: true, template: "<div class=\"ff-layout\">\r\n <!-- Header fijo -->\r\n <div class=\"ff-header\">\r\n <div class=\"ff-back-row\" *ngIf=\"!useBreadcrumb\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n icon=\"pi pi-arrow-left\"\r\n label=\"Volver\"\r\n (click)=\"goBack()\"\r\n ></button>\r\n </div>\r\n\r\n <!-- Toolbar: b\u00FAsqueda + botones de acci\u00F3n -->\r\n <div class=\"ff-toolbar\">\r\n <p-iconfield class=\"ff-toolbar__search\">\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input\r\n type=\"text\"\r\n pInputText\r\n [placeholder]=\"\r\n 'Buscar en ' +\r\n carpeta.label.replace('#toolbar=0&navpanes=0&statusbar=0', '')\r\n \"\r\n [(ngModel)]=\"searchQuery\"\r\n (input)=\"onSearchInput()\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n\r\n <div class=\"ff-toolbar__actions\">\r\n <lib-upload-dialog\r\n *ngIf=\"carpeta?.reglas?.permisos?.cargarFront\"\r\n [selectedDocument]=\"carpeta\"\r\n [allowedExtensions]=\"allowedUploadTypes\"\r\n (onUploaded)=\"fileChange($event)\"\r\n (loadFile)=\"cargarArchivo()\"\r\n >\r\n </lib-upload-dialog>\r\n\r\n <button\r\n pButton\r\n type=\"button\"\r\n icon=\"pi pi-trash\"\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n (click)=\"emitEliminarMasivo()\"\r\n [disabled]=\"docsEliminables.length === 0\"\r\n class=\"p-button-outlined p-button-danger p-button-sm ff-btn-delete\"\r\n >\r\n <span class=\"ff-btn-label\"\r\n >Eliminar ({{ docsEliminables.length }})</span\r\n >\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <!-- Fila seleccionar todo / total archivos -->\r\n <div class=\"ff-select-row\" *ngIf=\"!loading && items.length > 0\">\r\n <div class=\"ff-select-row__left\">\r\n <p-checkbox\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"allSelected\"\r\n (onChange)=\"toggleSelectAll()\"\r\n >\r\n </p-checkbox>\r\n <span\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n class=\"ff-select-row__label\"\r\n >Seleccionar todo</span\r\n >\r\n </div>\r\n <span class=\"ff-select-row__count\"\r\n >{{ totalRecords || items.length }}\r\n {{\r\n (totalRecords || items.length) === 1 ? \"archivo\" : \"archivos\"\r\n }}</span\r\n >\r\n </div>\r\n </div>\r\n\r\n <!-- Contenido scrollable -->\r\n <div class=\"ff-file-list-wrapper\">\r\n <!-- Loading -->\r\n <div *ngIf=\"loading\" class=\"ff-loading\">\r\n <i class=\"pi pi-spin pi-spinner\" style=\"font-size: 2rem\"></i>\r\n </div>\r\n\r\n <!-- Lista de archivos -->\r\n <div class=\"ff-file-list\" *ngIf=\"!loading\">\r\n <div\r\n class=\"ff-file-item\"\r\n *ngFor=\"let item of items\"\r\n (click)=\"openVisorDoc(item)\"\r\n >\r\n <p-checkbox\r\n *ngIf=\"carpeta?.reglas?.permisos?.borrarFront\"\r\n [binary]=\"true\"\r\n [(ngModel)]=\"item.delete\"\r\n (onChange)=\"onClickedCheckDelete($event, item)\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n </p-checkbox>\r\n\r\n <div class=\"ff-file-item__preview\">\r\n <i\r\n *ngIf=\"!canPreview(item.label, item.Path)\"\r\n class=\"pi ff-file-item__frame ff-file-item__icon\"\r\n [ngClass]=\"previewFallbackIcon(item.label, item.Path)\"\r\n ></i>\r\n <ng-container *ngIf=\"canPreview(item.label, item.Path)\">\r\n <embed\r\n *ngIf=\"carpeta.TipoArchivo == '2'\"\r\n class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\"\r\n />\r\n <img\r\n *ngIf=\"carpeta.TipoArchivo == '1' && isMobile\"\r\n class=\"ff-file-item__frame\"\r\n src=\"https://macuna.tecfinanzas.com/Imagenes/pdf_icon.png\"\r\n />\r\n <iframe\r\n *ngIf=\"carpeta.TipoArchivo == '1' && !isMobile\"\r\n class=\"ff-file-item__frame\"\r\n [src]=\"item.Path | safe\"\r\n frameborder=\"0\"\r\n ></iframe>\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"ff-file-item__info\">\r\n <span class=\"ff-file-item__name\">{{ item.label }}</span>\r\n <span class=\"ff-file-item__date\" *ngIf=\"item.FechaSubida && !isMobile\"\r\n >Fecha Subida:\r\n {{ item.FechaSubida | flexibleDate: \"dd/MM/yyyy HH:mm\" }}</span\r\n >\r\n <span\r\n class=\"ff-file-item__date\"\r\n *ngIf=\"item.FechaSubida && isMobile\"\r\n >{{ item.FechaSubida | flexibleDate: \"dd/MM/yyyy HH:mm\" }}</span\r\n >\r\n <i\r\n class=\"pi pi-external-link ff-file-item__open\"\r\n (click)=\"\r\n openCurrentInNewWindow(item.Path); $event.stopPropagation()\r\n \"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n aria-label=\"Abrir en nueva ventana\"\r\n (keydown.enter)=\"\r\n openCurrentInNewWindow(item.Path); $event.stopPropagation()\r\n \"\r\n ></i>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Sin resultados -->\r\n <div *ngIf=\"!loading && items.length === 0\" class=\"ff-empty\">\r\n Sin documentos cargados\r\n </div>\r\n </div>\r\n\r\n <!-- Footer fijo: paginaci\u00F3n compacta -->\r\n <div class=\"ff-footer\" *ngIf=\"usesApi && totalRecords > 0\">\r\n <div class=\"ff-pagination\">\r\n <p-select\r\n [options]=\"pageSizeOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [(ngModel)]=\"pageSize\"\r\n (ngModelChange)=\"onPageSizeChange()\"\r\n >\r\n </p-select>\r\n <p-paginator\r\n [first]=\"first\"\r\n [rows]=\"pageSize\"\r\n [totalRecords]=\"totalRecords\"\r\n (onPageChange)=\"onPageChange($event)\"\r\n [showCurrentPageReport]=\"true\"\r\n currentPageReportTemplate=\"{first} - {last} de {totalRecords}\"\r\n [showPageLinks]=\"false\"\r\n [showFirstLastIcon]=\"false\"\r\n >\r\n </p-paginator>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<p-dialog\r\n [(visible)]=\"displayView\"\r\n [header]=\"current_label.replace('#toolbar=0&navpanes=0&statusbar=0', '')\"\r\n [modal]=\"true\"\r\n [style]=\"{ width: '70vw' }\"\r\n>\r\n <div *ngIf=\"!canPreview()\" class=\"sf-doc-preview-fallback\">\r\n <i class=\"pi\" [ngClass]=\"previewFallbackIcon()\"></i>\r\n <p>La vista previa no est\u00E1 disponible para este tipo de archivo.</p>\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Abrir en una nueva ventana\"\r\n icon=\"pi pi-external-link\"\r\n (click)=\"openCurrentInNewWindow()\"\r\n ></button>\r\n </div>\r\n <ng-container *ngIf=\"canPreview()\">\r\n <embed\r\n *ngIf=\"carpeta.TipoArchivo == '2'\"\r\n [src]=\"current_path | safe\"\r\n style=\"width: 100%; min-height: 600px\"\r\n />\r\n <iframe\r\n *ngIf=\"carpeta.TipoArchivo == '1'\"\r\n style=\"width: 100%; min-height: 600px\"\r\n [src]=\"current_path | safe\"\r\n ></iframe>\r\n </ng-container>\r\n</p-dialog>\r\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.ff-header{flex-shrink:0}.ff-back-row{display:flex;margin-block:15px}.ff-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:4px;padding:.5rem}.ff-toolbar__search{flex:1;min-width:0}:host ::ng-deep .ff-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.ff-toolbar__actions{display:flex;align-items:center;gap:6px;flex-shrink:0}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px;padding:.4rem .75rem}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .ff-btn-delete{white-space:nowrap;font-size:13px;padding:.4rem .75rem}.ff-select-row{display:flex;align-items:center;justify-content:space-between;padding:8px 4px;border-bottom:1px solid #e5e7eb;padding:.5rem}.ff-select-row__left{display:flex;align-items:center;gap:8px}.ff-select-row__label{font-size:13px;color:#374151}.ff-select-row__count{font-size:13px;color:#6b7280}.ff-file-list-wrapper{flex:1;min-height:0;overflow-y:auto}.ff-loading{text-align:center;padding:20px}.ff-file-list{display:flex;flex-direction:column}.ff-file-item{display:flex;align-items:center;gap:12px;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.ff-file-item:hover{background-color:#f9fafb}.ff-file-item__preview{flex-shrink:0;width:85px;height:100px;overflow:hidden;display:flex;align-items:center;justify-content:center}.ff-file-item__frame{width:85px;height:100px;border:none;pointer-events:none;object-fit:cover}.ff-file-item__icon{display:flex;align-items:center;justify-content:center;font-size:40px;color:#6b7280;background-color:#f3f4f6;border-radius:4px}.ff-file-item__icon.pi-file-excel{color:#1d6f42;background-color:#f0faf5}.ff-file-item__icon.pi-file-pdf{color:#b91c1c;background-color:#fef2f2}.ff-file-item__icon.pi-file-word{color:#1d4ed8;background-color:#eff6ff}.ff-file-item__info{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;text-align:right}.ff-file-item__name{font-size:13px;font-weight:500;color:#111827;min-width:0;word-break:break-word}.ff-file-item__date{font-size:12px;color:#9ca3af;overflow:hidden}.ff-file-item__open{font-size:18px;color:#3b82f6;flex-shrink:0;padding:4px;border-radius:4px;transition:color .15s ease,background-color .15s ease;cursor:pointer;align-self:flex-end}.ff-file-item__open:hover{color:#2563eb;background-color:#eff6ff}.ff-empty{text-align:center;padding:20px;color:#999}.ff-footer{flex-shrink:0;border-top:1px solid #e5e7eb}.ff-pagination{display:flex;align-items:center;justify-content:flex-end;gap:4px;padding:6px 8px;font-size:13px}:host ::ng-deep .ff-pagination .p-select{width:auto;min-width:90px}:host ::ng-deep .ff-pagination .p-select .p-select-label{font-size:12px;padding:4px 8px}:host ::ng-deep .ff-pagination .p-paginator{padding:0;background:transparent;border:none;gap:0}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-current{font-size:12px;color:#6b7280;padding:0 6px;min-width:auto;height:auto}:host ::ng-deep .ff-pagination .p-paginator .p-paginator-prev,:host ::ng-deep .ff-pagination .p-paginator .p-paginator-next{min-width:28px;height:28px;font-size:12px}@media only screen and (max-width: 656px){.ff-toolbar{gap:6px}.ff-btn-label{display:none}:host ::ng-deep .ff-toolbar__actions lib-upload-dialog .p-button .p-button-label{display:none}:host ::ng-deep .ff-toolbar__actions .p-button{padding:.5rem}.ff-file-item__preview,.ff-file-item__frame{width:65px;height:80px}.ff-file-item__icon{font-size:28px}.ff-file-item__name{font-size:12px}.ff-file-item__date{font-size:11px}}.sf-doc-preview-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:300px;text-align:center;color:#374151}.sf-doc-preview-fallback i{font-size:48px;color:#6b7280}.sf-doc-preview-fallback i.pi-file-excel{color:#1d6f42}.sf-doc-preview-fallback i.pi-file-pdf{color:#b91c1c}.sf-doc-preview-fallback i.pi-file-word{color:#1d4ed8}.frameDoc{overflow:hidden;border:none}\n"] }]
487
+ }], ctorParameters: () => [], propDecorators: { carpeta: [{
396
488
  type: Input
397
489
  }], isMobile: [{
398
490
  type: Input
@@ -408,37 +500,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
408
500
  type: Input
409
501
  }], usesApi: [{
410
502
  type: Input
503
+ }], allowedUploadTypes: [{
504
+ type: Input
411
505
  }], onFileChange: [{
412
506
  type: Output
413
507
  }], onCargarArchivo: [{
414
508
  type: Output
415
509
  }], onEliminarMasivo: [{
416
510
  type: Output
417
- }], onOpenVisorDoc: [{
418
- type: Output
419
- }], onOpenNewWindow: [{
420
- type: Output
421
511
  }], onBack: [{
422
512
  type: Output
423
513
  }] } });
424
514
 
425
515
  class SfDocumentsComponent {
426
516
  sanitizer;
427
- dialog;
428
517
  snackBar;
429
518
  appRef;
430
519
  confirmationService;
431
520
  documentService;
432
521
  documentsService = inject(DOCUMENT_SERVICE);
433
- accion = "";
434
- entidad = "";
435
- ndoc = "";
436
- tdoc = "";
437
- tipo = "";
522
+ accion = '';
523
+ entidad = '';
524
+ ndoc = '';
525
+ tdoc = '';
526
+ tipo = '';
438
527
  //Información necesaria para cargar documentos de productos
439
- Kasociada = "";
440
- Producto = "";
441
- Solicitud = "";
528
+ Kasociada = '';
529
+ Producto = '';
530
+ Solicitud = '';
442
531
  oSession;
443
532
  perfilDocumentos;
444
533
  subestado = '';
@@ -451,24 +540,22 @@ class SfDocumentsComponent {
451
540
  nmco = [];
452
541
  useBreadcrumb = false;
453
542
  usesApi = true;
543
+ /** Extensiones permitidas para subir (ej. ['.pdf', '.xlsx']). Si no se define, usa el default de la librería (pdf, xls, xlsx). */
544
+ allowedUploadTypes;
454
545
  onNavigationChange = new EventEmitter();
455
- server = "";
456
- valorFiltro = "";
546
+ server = '';
547
+ valorFiltro = '';
457
548
  tab = 1;
458
549
  enProceso = false;
459
550
  carpetaSeleccionada;
460
551
  files;
461
552
  filesFilter;
462
553
  imagePathInput;
463
- modalReference;
464
- modalReference2;
465
554
  documentoSeleccionado;
466
555
  totalDocsEliminadosApi = { existoso: 0, fallido: 0 };
467
556
  file;
468
557
  urlDoc;
469
558
  pdfUrl;
470
- current_path = "";
471
- current_label = "";
472
559
  scanFileList = new Array();
473
560
  displayPDF = false;
474
561
  panel;
@@ -484,9 +571,8 @@ class SfDocumentsComponent {
484
571
  dynamicValues = {};
485
572
  selectedDocType = null;
486
573
  selectedRange = null;
487
- constructor(sanitizer, dialog, snackBar, appRef, confirmationService, documentService) {
574
+ constructor(sanitizer, snackBar, appRef, confirmationService, documentService) {
488
575
  this.sanitizer = sanitizer;
489
- this.dialog = dialog;
490
576
  this.snackBar = snackBar;
491
577
  this.appRef = appRef;
492
578
  this.confirmationService = confirmationService;
@@ -505,16 +591,12 @@ class SfDocumentsComponent {
505
591
  this.files = [];
506
592
  this.filesFilter = [];
507
593
  this.imagePathInput = null;
508
- this.modalReference = undefined;
509
- this.modalReference2 = undefined;
510
594
  this.carpetaSeleccionada = null;
511
595
  this.documentoSeleccionado = null;
512
596
  this.totalDocsEliminadosApi = { existoso: 0, fallido: 0 };
513
597
  this.file = null;
514
598
  this.urlDoc = null;
515
599
  this.pdfUrl = null;
516
- this.current_path = "";
517
- this.current_label = "";
518
600
  this.scanFileList = new Array();
519
601
  this.displayPDF = false;
520
602
  this.displayGenerate = false;
@@ -526,7 +608,9 @@ class SfDocumentsComponent {
526
608
  this.dynamicValues = {};
527
609
  this.selectedDocType = null;
528
610
  this.selectedRange = null;
529
- if (this.oSession != null && this.oSession.UsuarioSistema.TDOC !== undefined && this.oSession.UsuarioSistema.NDOC !== undefined) {
611
+ if (this.oSession != null &&
612
+ this.oSession.UsuarioSistema.TDOC !== undefined &&
613
+ this.oSession.UsuarioSistema.NDOC !== undefined) {
530
614
  this.idKatios = this.oSession.UsuarioSistema.IDKATIOS.trim();
531
615
  this.perfilDocumentos = this.oSession.UsuarioSistema.PERDOCUMENTOS.trim();
532
616
  }
@@ -546,14 +630,18 @@ class SfDocumentsComponent {
546
630
  ndoc: this.ndoc,
547
631
  request: this.Solicitud,
548
632
  documentProfile: this.perfilDocumentos,
549
- product: this.Producto
633
+ product: this.Producto,
550
634
  };
551
- this.documentsService.getFolders(this.idKatios, data).pipe(tap((response) => {
635
+ this.documentsService
636
+ .getFolders(this.idKatios, data)
637
+ .pipe(tap((response) => {
552
638
  let res = response.data;
553
639
  if (response.data.RESPUESTA)
554
640
  res = response.data.RESPUESTA;
555
641
  this.okCargoArbol(res);
556
- }), switchMap(() => this.Solicitud ? this.documentsService.getDocumentsToGenerate(this.idKatios, this.Solicitud) : of(null)), tap((resp) => {
642
+ }), switchMap(() => this.Solicitud
643
+ ? this.documentsService.getDocumentsToGenerate(this.idKatios, this.Solicitud)
644
+ : of(null)), tap((resp) => {
557
645
  const list = resp?.data ?? []; // según tu JSON real
558
646
  this.documentsToGenerate = list;
559
647
  this.documentsToGenerateMap = {};
@@ -561,14 +649,15 @@ class SfDocumentsComponent {
561
649
  // dropdown: usa idDoc pero mantén objeto completo en map
562
650
  this.documentTypes = list.map((d) => ({
563
651
  label: d.description,
564
- code: d.idDoc
652
+ code: d.idDoc,
565
653
  }));
566
654
  }), finalize(() => {
567
655
  this.documentService.loadingData = false;
568
- })).subscribe({
656
+ }))
657
+ .subscribe({
569
658
  error: (error) => {
570
659
  this.errorCargarArbol(error);
571
- }
660
+ },
572
661
  });
573
662
  this.tab = 1;
574
663
  this.documentoSeleccionado = null;
@@ -584,14 +673,14 @@ class SfDocumentsComponent {
584
673
  var objeto;
585
674
  objeto = node;
586
675
  if (node.children && node.children?.length > 0) {
587
- node.children.forEach(childNode => {
676
+ node.children.forEach((childNode) => {
588
677
  this.expandRecursive(childNode, isExpand);
589
678
  });
590
679
  }
591
680
  else if (objeto.Path !== undefined) {
592
681
  var path = 'Imagenes/' + objeto.Path + objeto.label;
593
682
  var re = /[\\]/gi;
594
- path = path.replace(re, "/");
683
+ path = path.replace(re, '/');
595
684
  objeto.Path = this.server + path;
596
685
  //this.sanitizer.bypassSecurityTrustUrl(this.server + path)
597
686
  }
@@ -615,7 +704,7 @@ class SfDocumentsComponent {
615
704
  this.documentService.loadingData = false;
616
705
  };
617
706
  errorCargarArbol = (iError) => {
618
- this.message("error", "Error al traer la información", iError.message);
707
+ this.message('error', 'Error al traer la información', iError.message);
619
708
  this.documentService.loadingData = false;
620
709
  };
621
710
  // onClickedCheckDelete($event: any, document: any) {
@@ -624,19 +713,23 @@ class SfDocumentsComponent {
624
713
  // }
625
714
  funcOkDelDocumentMasivo = (docsEliminables) => {
626
715
  this.totalDocsEliminadosApi.existoso += 1;
627
- if (this.totalDocsEliminadosApi.existoso + this.totalDocsEliminadosApi.fallido === docsEliminables.length) {
716
+ if (this.totalDocsEliminadosApi.existoso +
717
+ this.totalDocsEliminadosApi.fallido ===
718
+ docsEliminables.length) {
628
719
  this.cargarParametros(this.tipo);
629
720
  if (this.totalDocsEliminadosApi.fallido > 0)
630
- this.message("warn", "", "Algunos documentos no pudieron ser eliminados");
721
+ this.message('warn', '', 'Algunos documentos no pudieron ser eliminados');
631
722
  else
632
- this.message("success", "", "Documentos eliminados satisfactoriamente");
723
+ this.message('success', '', 'Documentos eliminados satisfactoriamente');
633
724
  }
634
725
  };
635
726
  funcErrDelDocumentMasivo = (docsEliminables) => {
636
727
  this.totalDocsEliminadosApi.fallido += 1;
637
- if (this.totalDocsEliminadosApi.existoso + this.totalDocsEliminadosApi.fallido === docsEliminables.length) {
728
+ if (this.totalDocsEliminadosApi.existoso +
729
+ this.totalDocsEliminadosApi.fallido ===
730
+ docsEliminables.length) {
638
731
  this.cargarParametros(this.tipo);
639
- this.message("warn", "", "Algunos documentos no pudieron ser eliminados");
732
+ this.message('warn', '', 'Algunos documentos no pudieron ser eliminados');
640
733
  }
641
734
  };
642
735
  eliminarMasivo(docsEliminables) {
@@ -647,8 +740,8 @@ class SfDocumentsComponent {
647
740
  accept: () => {
648
741
  this.documentService.loading = true;
649
742
  this.totalDocsEliminadosApi = { existoso: 0, fallido: 0 };
650
- docsEliminables.forEach(doc => {
651
- let data = { "code": doc.codigo, "status": "DES" };
743
+ docsEliminables.forEach((doc) => {
744
+ let data = { code: doc.codigo, status: 'DES' };
652
745
  this.documentsService.updateStatus(this.idKatios, data).subscribe({
653
746
  next: (response) => {
654
747
  this.funcOkDelDocumentMasivo(docsEliminables);
@@ -656,10 +749,10 @@ class SfDocumentsComponent {
656
749
  error: (error) => {
657
750
  this.documentService.loading = false;
658
751
  this.funcErrDelDocumentMasivo(docsEliminables);
659
- }
752
+ },
660
753
  });
661
754
  });
662
- }
755
+ },
663
756
  });
664
757
  }
665
758
  filtrarTipoDocumento(iArbol) {
@@ -679,25 +772,6 @@ class SfDocumentsComponent {
679
772
  this.convertirArrayChildren(childNode);
680
773
  });
681
774
  }
682
- openBigModal(content) {
683
- this.modalReference = this.dialog.open(content, {
684
- width: '70%',
685
- modal: true,
686
- closable: true
687
- });
688
- this.modalReference.onClose.subscribe((result) => {
689
- //this.closeResult = `Closed with: ${result}`;
690
- });
691
- // this.modalReference.onHide.subscribe(() => {
692
- // //this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
693
- // });
694
- }
695
- openModal2(content) {
696
- this.modalReference2 = this.dialog.open(content, {});
697
- this.modalReference2.onClose.subscribe((result) => {
698
- //this.closeResult = `Closed with: ${result}`;
699
- });
700
- }
701
775
  // takePhotoClick() {
702
776
  // this.documentsService.openCamera(this.ok_openCamera, this.error_openCamera);
703
777
  // }
@@ -730,11 +804,11 @@ class SfDocumentsComponent {
730
804
  // }
731
805
  loadFileToList(file) {
732
806
  setTimeout(() => {
733
- file["name"] = "scan" + Date.now() + this.scanFileList.length + ".jpg";
807
+ file['name'] = 'scan' + Date.now() + this.scanFileList.length + '.jpg';
734
808
  this.scanFileList.push(file);
735
809
  this.scanFileList = this.scanFileList.slice();
736
810
  this.documentService.loading = false;
737
- this.message("success", "", "Archivo cargado exitosamente");
811
+ this.message('success', '', 'Archivo cargado exitosamente');
738
812
  this.appRef.tick();
739
813
  }, 200);
740
814
  }
@@ -747,72 +821,66 @@ class SfDocumentsComponent {
747
821
  // }
748
822
  noZonePatch(cb) {
749
823
  const orig = FileReader;
750
- const unpatched = window.FileReader.__zone_symbol__OriginalDelegate;
824
+ const unpatched = window.FileReader
825
+ .__zone_symbol__OriginalDelegate;
751
826
  window.FileReader = unpatched;
752
827
  cb();
753
828
  window.FileReader = orig;
754
829
  }
755
- makeFileIntoBlob(_imagePath) {
756
- this.documentService.loading = true;
757
- // INSTALL PLUGIN - cordova plugin add cordova-plugin-file
758
- return new Promise((resolve, reject) => {
759
- try {
760
- window.resolveLocalFileSystemURL(_imagePath, (fileEntry) => {
761
- fileEntry.file((resFile) => {
762
- this.noZonePatch(() => {
763
- var reader = new FileReader();
764
- reader.onloadend = (evt) => {
765
- var imgBlob = new Blob([evt.target.result], { type: 'image/jpeg' });
766
- imgBlob.name = 'scan.jpg';
767
- resolve(imgBlob);
768
- };
769
- reader.onerror = (e) => {
770
- console.log('Failed file read: ' + e.toString());
771
- reject(e);
772
- };
773
- reader.readAsArrayBuffer(resFile);
774
- }); //!Comentarear esta linea y una de de arriba para ambiente de prueba
775
- });
776
- }, (error) => {
777
- console.error('Error resolving file system URL:', error);
778
- reject(error);
779
- });
780
- }
781
- catch (ex) {
782
- console.error('Error in makeFileIntoBlob:', ex);
783
- reject(ex);
784
- }
785
- });
786
- }
830
+ // makeFileIntoBlob(_imagePath: any): Promise<Blob> {
831
+ // this.documentService.loading = true;
832
+ // // INSTALL PLUGIN - cordova plugin add cordova-plugin-file
833
+ // return new Promise((resolve, reject) => {
834
+ // try {
835
+ // window.resolveLocalFileSystemURL(_imagePath, (fileEntry: any) => {
836
+ // fileEntry.file((resFile: any) => {
837
+ // this.noZonePatch(() => {//! Alert 1: Comentarear esta linea y una de de abajo para ambiente de prueba
838
+ // var reader = new FileReader();
839
+ // reader.onloadend = (evt: any) => {
840
+ // var imgBlob: any = new Blob([evt.target.result], { type: 'image/jpeg' });
841
+ // imgBlob.name = 'scan.jpg';
842
+ // resolve(imgBlob);
843
+ // };
844
+ // reader.onerror = (e) => {
845
+ // console.log('Failed file read: ' + e.toString());
846
+ // reject(e);
847
+ // };
848
+ // reader.readAsArrayBuffer(resFile);
849
+ // });//!Comentarear esta linea y una de de arriba para ambiente de prueba
850
+ // });
851
+ // }, (error: any) => {
852
+ // console.error('Error resolving file system URL:', error);
853
+ // reject(error);
854
+ // });
855
+ // } catch (ex) {
856
+ // console.error('Error in makeFileIntoBlob:', ex);
857
+ // reject(ex);
858
+ // }
859
+ // });
860
+ // }
787
861
  subirImagen(data, fileList) {
788
862
  this.documentService.loading = true;
789
863
  const formData = new FormData();
790
864
  var dataDocs;
791
865
  var sIdKatios = this.idKatios;
792
- dataDocs = { "data": data };
866
+ dataDocs = { data: data };
793
867
  formData.append('data', JSON.stringify(dataDocs));
794
- formData.append('merge', "true");
868
+ formData.append('merge', 'true');
795
869
  for (let _i = 0; _i < fileList.length; _i++) {
796
870
  formData.append('files', fileList[_i], fileList[_i].name);
797
871
  }
798
872
  this.documentsService.uploadFiles(sIdKatios, formData).subscribe({
799
873
  next: (response) => {
800
874
  this.scanFileList = new Array();
801
- if (this.modalReference2) {
802
- this.modalReference2.close();
803
- }
804
- if (this.modalReference) {
805
- this.modalReference.close();
806
- }
807
- this.message("success", "Felicidades", "Se almacenó el documento correctamente");
875
+ this.message('success', 'Felicidades', 'Se almacenó el documento correctamente');
808
876
  this.cargarParametros(this.tipo);
809
877
  this.documentService.loading = false;
810
878
  this.appRef.tick();
811
879
  },
812
880
  error: (err) => {
813
881
  this.documentService.loading = false;
814
- this.message("error", "Se presentaron inconvenientes almacenando el documento", err.message);
815
- console.error("Error : " + err);
882
+ this.message('error', 'Se presentaron inconvenientes almacenando el documento', err.message);
883
+ console.error('Error : ' + err);
816
884
  },
817
885
  });
818
886
  }
@@ -820,72 +888,57 @@ class SfDocumentsComponent {
820
888
  this.documentService.loading = true;
821
889
  var sPath1;
822
890
  var dataClientes;
823
- let sPaths = "";
824
- if (this.documentoSeleccionado.Tipo.trim().toUpperCase() == "PERSONA") {
825
- sPath1 = this.documentoSeleccionado.Tipo.trim() + "\\" + this.tdoc.trim() +
826
- "\\" + this.ndoc.trim() + "\\Cliente\\" + this.documentoSeleccionado.NMCo.trim();
891
+ let sPaths = '';
892
+ if (this.documentoSeleccionado.Tipo.trim().toUpperCase() == 'PERSONA') {
893
+ sPath1 =
894
+ this.documentoSeleccionado.Tipo.trim() +
895
+ '\\' +
896
+ this.tdoc.trim() +
897
+ '\\' +
898
+ this.ndoc.trim() +
899
+ '\\Cliente\\' +
900
+ this.documentoSeleccionado.NMCo.trim();
827
901
  }
828
902
  else {
829
903
  //Kasociada
830
904
  //producto
831
905
  //Falta numero de solicitud
832
- sPath1 = this.documentoSeleccionado.Tipo.trim() + "\\" + this.Kasociada +
833
- "\\" + this.Producto + "\\" + this.Solicitud + "\\" + this.documentoSeleccionado.NMCo;
906
+ sPath1 =
907
+ this.documentoSeleccionado.Tipo.trim() +
908
+ '\\' +
909
+ this.Kasociada +
910
+ '\\' +
911
+ this.Producto +
912
+ '\\' +
913
+ this.Solicitud +
914
+ '\\' +
915
+ this.documentoSeleccionado.NMCo;
834
916
  }
835
917
  dataClientes = {
836
- "Tipo": this.documentoSeleccionado.Tipo,
837
- "id": "1",
838
- "documento": this.documentoSeleccionado.NMCo,
839
- "tdoc": this.tdoc.trim(),
840
- "ndoc": this.ndoc.trim(),
841
- "IdProducto": this.Solicitud,
842
- "TipoProducto": this.Producto,
843
- "Kasociada": this.Kasociada,
844
- "archivoUpload": fileList[0],
845
- "nombre": this.tdoc.trim() + '-' + this.ndoc.trim(),
846
- "fileCargado": fileList[0],
847
- "pathArchivo": sPath1,
848
- "TipoArchivo": this.documentoSeleccionado.TipoArchivo
918
+ Tipo: this.documentoSeleccionado.Tipo,
919
+ id: '1',
920
+ documento: this.documentoSeleccionado.NMCo,
921
+ tdoc: this.tdoc.trim(),
922
+ ndoc: this.ndoc.trim(),
923
+ IdProducto: this.Solicitud,
924
+ TipoProducto: this.Producto,
925
+ Kasociada: this.Kasociada,
926
+ archivoUpload: fileList[0],
927
+ nombre: this.tdoc.trim() + '-' + this.ndoc.trim(),
928
+ fileCargado: fileList[0],
929
+ pathArchivo: sPath1,
930
+ TipoArchivo: this.documentoSeleccionado.TipoArchivo,
849
931
  };
850
- sPaths = sPaths + sPath1 + ",";
932
+ sPaths = sPaths + sPath1 + ',';
851
933
  this.subirImagen(dataClientes, fileList);
852
934
  }
853
935
  cargarArchivo(iNodo) {
854
936
  this.scanFileList = new Array();
855
937
  this.documentoSeleccionado = iNodo;
856
938
  }
857
- async openDoc(item, pdfContent) {
858
- if (this.carpetaSeleccionada.TipoArchivo == '1' && this.isMobile) {
859
- cordova.InAppBrowser.open(item.Path, '_system', 'location=yes');
860
- }
861
- else {
862
- this.current_path = item.Path;
863
- this.current_label = item.label;
864
- this.openBigModal(pdfContent);
865
- }
866
- }
867
- openVisorDoc(item) {
868
- if (this.carpetaSeleccionada.TipoArchivo == '1' && this.isMobile) { //is mobile
869
- cordova.InAppBrowser.open(item.Path, '_system', 'location=yes');
870
- }
871
- else {
872
- this.current_path = item.Path;
873
- this.current_label = item.label;
874
- this.displayPDF = true;
875
- }
876
- }
877
- async openNewWindow(item) {
878
- window.open(item.Path, '_blank').focus();
879
- }
880
- isCurrentExcel() {
881
- return isExcelFileName(this.current_label) || isExcelFileName(this.current_path);
882
- }
883
- openCurrentInNewWindow() {
884
- window.open(this.current_path, '_blank').focus();
885
- }
886
939
  async seleccionoDocs(iNodo) {
887
940
  var path = iNodo.Path + iNodo.label;
888
- this.pdfUrl = "//imagenes//" + iNodo.idKatios + "//" + path;
941
+ this.pdfUrl = '//imagenes//' + iNodo.idKatios + '//' + path;
889
942
  this.pdfUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.pdfUrl);
890
943
  this.gotoBottom();
891
944
  }
@@ -894,7 +947,7 @@ class SfDocumentsComponent {
894
947
  severity: severity,
895
948
  summary: summary,
896
949
  detail: message,
897
- life: 4000
950
+ life: 4000,
898
951
  });
899
952
  }
900
953
  gotoBottom() {
@@ -908,7 +961,7 @@ class SfDocumentsComponent {
908
961
  ndoc: this.ndoc,
909
962
  request: this.Solicitud,
910
963
  documentProfile: this.perfilDocumentos,
911
- product: this.Producto
964
+ product: this.Producto,
912
965
  };
913
966
  }
914
967
  VerDetalleTab(items) {
@@ -926,8 +979,7 @@ class SfDocumentsComponent {
926
979
  return;
927
980
  const state = { tab: this.tab };
928
981
  if (this.tab === 2 && this.carpetaSeleccionada) {
929
- state.folderLabel = (this.carpetaSeleccionada.label || '')
930
- .replace('#toolbar=0&navpanes=0&statusbar=0', '');
982
+ state.folderLabel = (this.carpetaSeleccionada.label || '').replace('#toolbar=0&navpanes=0&statusbar=0', '');
931
983
  }
932
984
  this.onNavigationChange.emit(state);
933
985
  }
@@ -936,23 +988,24 @@ class SfDocumentsComponent {
936
988
  this.nextTabPapa.emit(iValor);
937
989
  }
938
990
  else {
939
- var respuesta = "";
991
+ var respuesta = '';
940
992
  if (this.files)
941
993
  respuesta = this.valorDocumentosPendientes(this.files[0]);
942
- if (respuesta == "") {
994
+ if (respuesta == '') {
943
995
  this.nextTabPapa.emit(iValor);
944
996
  }
945
997
  else {
946
- this.message("warn", "Ups!", respuesta);
998
+ this.message('warn', 'Ups!', respuesta);
947
999
  }
948
1000
  }
949
1001
  }
950
1002
  valorDocumentosPendientes(carpetas) {
951
- var respuesta = "";
1003
+ var respuesta = '';
952
1004
  if (carpetas.children) {
953
1005
  carpetas.children.forEach((carpeta) => {
954
- if (carpeta.Obligatorio == 1 && (!carpeta.children || carpeta.children.length == 0))
955
- respuesta = "Falta " + carpeta.label;
1006
+ if (carpeta.Obligatorio == 1 &&
1007
+ (!carpeta.children || carpeta.children.length == 0))
1008
+ respuesta = 'Falta ' + carpeta.label;
956
1009
  });
957
1010
  }
958
1011
  return respuesta;
@@ -969,14 +1022,6 @@ class SfDocumentsComponent {
969
1022
  this.filesFilter[i].children = node;
970
1023
  }
971
1024
  }
972
- ngOnDestroy() {
973
- if (this.modalReference) {
974
- this.modalReference.close();
975
- }
976
- if (this.modalReference2) {
977
- this.modalReference2.close();
978
- }
979
- }
980
1025
  openGenerateDialog() {
981
1026
  this.selectedDocType = null;
982
1027
  this.selectedRange = null;
@@ -1000,15 +1045,15 @@ class SfDocumentsComponent {
1000
1045
  const key = p.name;
1001
1046
  const raw = this.dynamicValues?.[key];
1002
1047
  paramsToSend[p.name] =
1003
- (p.type || '').toLowerCase() === 'date'
1004
- ? this.toYYYYMMDD(raw)
1005
- : raw;
1048
+ (p.type || '').toLowerCase() === 'date' ? this.toYYYYMMDD(raw) : raw;
1006
1049
  }
1007
1050
  this.enProceso = true;
1008
1051
  const payload = {
1009
- params: paramsToSend
1052
+ params: paramsToSend,
1010
1053
  };
1011
- this.documentsService.generateDocument(this.idKatios, this.selectedDocType, this.Solicitud, payload).subscribe({
1054
+ this.documentsService
1055
+ .generateDocument(this.idKatios, this.selectedDocType, this.Solicitud, payload)
1056
+ .subscribe({
1012
1057
  next: () => {
1013
1058
  this.displayGenerate = false;
1014
1059
  this.message('success', '', 'Documento en generación');
@@ -1018,7 +1063,7 @@ class SfDocumentsComponent {
1018
1063
  error: (err) => {
1019
1064
  this.message('error', 'No se pudo generar el documento', err?.message || err);
1020
1065
  this.enProceso = false;
1021
- }
1066
+ },
1022
1067
  });
1023
1068
  }
1024
1069
  toYYYYMMDD(value) {
@@ -1031,7 +1076,9 @@ class SfDocumentsComponent {
1031
1076
  return d.toISOString().slice(0, 10);
1032
1077
  }
1033
1078
  onDocTypeChange() {
1034
- const doc = this.selectedDocType ? this.documentsToGenerateMap[this.selectedDocType] : null;
1079
+ const doc = this.selectedDocType
1080
+ ? this.documentsToGenerateMap[this.selectedDocType]
1081
+ : null;
1035
1082
  this.dynamicParams = doc?.params ?? [];
1036
1083
  this.dynamicValues = {}; // reset valores
1037
1084
  // valores default opcionales
@@ -1040,18 +1087,30 @@ class SfDocumentsComponent {
1040
1087
  this.dynamicValues[key] = null;
1041
1088
  }
1042
1089
  }
1043
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SfDocumentsComponent, deps: [{ token: i1.DomSanitizer }, { token: i2$1.DialogService }, { token: i3$1.MessageService }, { token: i0.ApplicationRef }, { token: i3$1.ConfirmationService }, { token: SfDocumentsService }], target: i0.ɵɵFactoryTarget.Component });
1044
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: SfDocumentsComponent, isStandalone: true, selector: "app-sf-documents", inputs: { accion: "accion", entidad: "entidad", ndoc: "ndoc", tdoc: "tdoc", tipo: "tipo", Kasociada: "Kasociada", Producto: "Producto", Solicitud: "Solicitud", oSession: "oSession", perfilDocumentos: "perfilDocumentos", subestado: "subestado", isMobile: "isMobile", bAtras: "bAtras", bFinal: "bFinal", botones: "botones", aplFiltro: "aplFiltro", nmco: "nmco", useBreadcrumb: "useBreadcrumb", usesApi: "usesApi", server: "server", idKatios: "idKatios" }, outputs: { nextTabPapa: "nextTabPapa", onNavigationChange: "onNavigationChange" }, providers: [DialogService, ConfirmationService], viewQueries: [{ propertyName: "panel", first: true, predicate: ["pdf"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div class=\"sf-doc-layout\">\r\n <div class=\"sf-doc-fixed\">\r\n <div class=\"buttons\" *ngIf=\"botones\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button pButton type=\"button\" label=\"Atras\" icon=\"pi pi-arrow-left\" (click)=\"next(-1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"!bFinal && botones\">\r\n <button pButton type=\"button\" label=\"Siguiente\" icon=\"pi pi-arrow-right\" (click)=\"next(1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button pButton type=\"button\" label=\"Finalizar\" icon=\"pi pi-home\" (click)=\"next(0)\"></button>\r\n </div>\r\n </div>\r\n <!-- Toolbar superior (solo tab 1) -->\r\n <div *ngIf=\"tab==1\" class=\"doc-toolbar\">\r\n <div class=\"doc-toolbar-left\" *ngIf=\"aplFiltro\">\r\n <p-iconfield>\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input type=\"text\" pInputText placeholder=\"Buscar carpeta...\" [(ngModel)]=\"valorFiltro\"\r\n (keyup)=\"filtrarDocumentos()\" class=\"w-full\" [disabled]=\"documentService.loadingData\">\r\n </p-iconfield>\r\n </div>\r\n\r\n <div class=\"doc-toolbar-right\" *ngIf=\"(documentTypes.length > 0)\">\r\n <button pButton type=\"button\" label=\"Generar documento\" icon=\"pi pi-plus\" class=\"p-button-sm\"\r\n (click)=\"openGenerateDialog()\" [disabled]=\"enProceso || !canGenerate\">\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <p-confirmDialog header=\"Atencion\" icon=\"pi pi-exclamation-triangle\"></p-confirmDialog>\r\n <div class=\"sf-doc-scrollable\" *ngIf=\"tab==1\">\r\n <div class=\"folder-list\">\r\n @if(!documentService.loadingData){\r\n <ng-container *ngFor=\"let carpeta of filesFilter\">\r\n <div class=\"folder-list\">\r\n <div class=\"folder-item\" *ngFor=\"let item of carpeta.children\" (click)=\"VerDetalleTab(item)\">\r\n <i class=\"pi pi-folder folder-item__icon\"\r\n [ngStyle]=\"{'color': (item.children?.length > 0 || item.fileCount > 0) ? 'green':'red' }\"></i>\r\n <div class=\"folder-item__info\">\r\n <span class=\"folder-item__name\">{{item.label}}</span>\r\n <span class=\"folder-item__count\" *ngIf=\"item.children?.length > 0\">{{item.children.length}}\r\n {{item.children.length === 1 ? 'archivo' : 'archivos'}}</span>\r\n <span class=\"folder-item__count\"\r\n *ngIf=\"(!item.children || item.children.length === 0) && item.fileCount\">{{item.fileCount}}\r\n {{item.fileCount === 1 ? 'archivo' : 'archivos'}}</span>\r\n <span class=\"folder-item__count\"\r\n *ngIf=\"(!item.children || item.children.length === 0) && !item.fileCount\">0\r\n archivos</span>\r\n </div>\r\n <i class=\"pi pi-chevron-right folder-item__arrow\"></i>\r\n </div>\r\n </div>\r\n </ng-container>\r\n }\r\n @else{\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <ng-container *ngIf=\"botones\">\r\n <div class=\"buttons\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button pButton type=\"button\" label=\"Atras\" icon=\"pi pi-arrow-left\" (click)=\"next(-1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"!bFinal && botones\">\r\n <button pButton type=\"button\" label=\"Siguiente\" icon=\"pi pi-arrow-right\" (click)=\"next(1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button pButton type=\"button\" label=\"Finalizar\" icon=\"pi pi-home\" (click)=\"next(0)\"></button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"sf-doc-scrollable sf-doc-scrollable--files\" *ngIf=\"tab==2\">\r\n <lib-folder-files [carpeta]=\"carpetaSeleccionada\" [isMobile]=\"isMobile\" [idKatios]=\"idKatios\" [server]=\"server\"\r\n [subestado]=\"subestado\" [requestData]=\"requestData\" [useBreadcrumb]=\"useBreadcrumb\" [usesApi]=\"usesApi\"\r\n (onFileChange)=\"fileChange($event)\" (onCargarArchivo)=\"cargarArchivo($event)\"\r\n (onOpenVisorDoc)=\"openVisorDoc($event)\" (onOpenNewWindow)=\"openNewWindow($event)\"\r\n (onEliminarMasivo)=\"eliminarMasivo($event)\" (onBack)=\"goToTab('1')\">\r\n </lib-folder-files>\r\n </div>\r\n</div>\r\n\r\n<p-dialog *ngIf=\"displayPDF\" [(visible)]=\"displayPDF\"\r\n header=\"{{current_label.replace('#toolbar=0&navpanes=0&statusbar=0','')}}\" [modal]=\"true\" [style]=\"{width: '70vw'}\">\r\n <div *ngIf=\"isCurrentExcel()\" class=\"sf-doc-excel-fallback\">\r\n <i class=\"pi pi-file-excel\"></i>\r\n <p>La vista previa no est\u00E1 disponible para archivos de Excel.</p>\r\n <button pButton type=\"button\" label=\"Abrir en una nueva ventana\" icon=\"pi pi-external-link\"\r\n (click)=\"openCurrentInNewWindow()\"></button>\r\n </div>\r\n <ng-container *ngIf=\"!isCurrentExcel()\">\r\n <embed *ngIf=\"carpetaSeleccionada.TipoArchivo == '2'\" [src]=\"current_path | safe\"\r\n style=\"width:100%; min-height: 600px\">\r\n <iframe *ngIf=\"carpetaSeleccionada.TipoArchivo == '1'\" style=\"width:100%; min-height: 600px\"\r\n [src]=\"current_path | safe\"></iframe>\r\n </ng-container>\r\n</p-dialog>\r\n\r\n\r\n<ng-template #pdfContent>\r\n <div class=\"modal-header\">\r\n <h4 class=\"modal-title\" id=\"modal-basic-title\">{{current_label.replace('#toolbar=0&navpanes=0&statusbar=0','')}}\r\n </h4>\r\n <button type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"modalReference?.close()\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div>\r\n <div *ngIf=\"isCurrentExcel()\" class=\"sf-doc-excel-fallback\">\r\n <i class=\"pi pi-file-excel\"></i>\r\n <p>La vista previa no est\u00E1 disponible para archivos de Excel.</p>\r\n <button pButton type=\"button\" label=\"Abrir en una nueva ventana\" icon=\"pi pi-external-link\"\r\n (click)=\"openCurrentInNewWindow()\"></button>\r\n </div>\r\n <ng-container *ngIf=\"!isCurrentExcel()\">\r\n <embed *ngIf=\"carpetaSeleccionada.TipoArchivo == '2'\" [src]=\"current_path | safe\"\r\n style=\"width:100%; min-height: 600px\">\r\n <iframe *ngIf=\"carpetaSeleccionada.TipoArchivo == '1'\" style=\"width:100%; min-height: 600px\"\r\n [src]=\"current_path | safe\"></iframe>\r\n </ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- <ng-template #scanContent>\r\n <div class=\"div-table\">\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <h4>Escanear documentos</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n Archivos cargados: <h4>{{scanFileList.length}}</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <label (click)=\"takePhotoClick()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">add_to_photos</mat-icon>\r\n </label>\r\n\r\n <label *ngIf=\"scanFileList.length != 0\" (click)=\"subirFotosScan()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">share</mat-icon>\r\n </label>\r\n </div>\r\n </div>\r\n</ng-template> -->\r\n<p-dialog header=\"Generar documento\" [(visible)]=\"displayGenerate\" [modal]=\"true\" [closable]=\"true\"\r\n [style]=\"{width: isMobile ? '95vw' : '520px'}\">\r\n\r\n <div class=\"gen-form\">\r\n <!-- Tipo de documento -->\r\n <div class=\"gen-field\">\r\n <label class=\"gen-label\">Tipo de documento</label>\r\n <p-dropdown class=\"gen-control\" [options]=\"documentTypes\" optionLabel=\"label\" optionValue=\"code\"\r\n [(ngModel)]=\"selectedDocType\" placeholder=\"Seleccione un tipo\" appendTo=\"body\" (onChange)=\"onDocTypeChange()\">\r\n </p-dropdown>\r\n </div>\r\n\r\n <!-- Par\u00E1metros din\u00E1micos -->\r\n <div class=\"gen-section\" *ngIf=\"dynamicParams.length\">\r\n <div class=\"gen-field\" *ngFor=\"let p of dynamicParams\">\r\n <label class=\"gen-label\">\r\n {{ p.description }}\r\n <span class=\"gen-required\" *ngIf=\"p.required\">*</span>\r\n </label>\r\n\r\n <!-- Date -->\r\n <p-datepicker *ngIf=\"(p.type || '').toLowerCase() === 'date'\" class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\" [showIcon]=\"true\" appendTo=\"body\" dateFormat=\"yy-mm-dd\">\r\n </p-datepicker>\r\n\r\n <!-- String -->\r\n <input *ngIf=\"(p.type || '').toLowerCase() === 'nvarchar' || (p.type || '').toLowerCase() === 'string'\"\r\n pInputText class=\"gen-control\" [(ngModel)]=\"dynamicValues[p.name]\" placeholder=\"Ingrese un valor\" />\r\n\r\n <!-- Number -->\r\n <p-inputNumber *ngIf=\"['int','decimal','number'].includes((p.type || '').toLowerCase())\" class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\">\r\n </p-inputNumber>\r\n\r\n <!-- Boolean -->\r\n <div class=\"gen-control gen-checkbox\" *ngIf=\"['boolean','bit','bool'].includes((p.type || '').toLowerCase())\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"dynamicValues[p.name]\">\r\n </p-checkbox>\r\n <span class=\"gen-checkbox-label\">S\u00ED</span>\r\n </div>\r\n\r\n <!-- helper opcional -->\r\n <small class=\"gen-help\" *ngIf=\"p.help\">{{ p.help }}</small>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-template pTemplate=\"footer\">\r\n <button pButton type=\"button\" label=\"Cancelar\" class=\"p-button-text\" (click)=\"displayGenerate=false\"></button>\r\n\r\n <button pButton type=\"button\" label=\"Generar\" icon=\"pi pi-cog\" (click)=\"generateDocument()\"\r\n [disabled]=\"!selectedDocType || enProceso\">\r\n </button>\r\n </ng-template>\r\n</p-dialog>", styles: [":host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-fixed{flex-shrink:0}.sf-doc-scrollable{flex:1;min-height:0;overflow-y:auto}.sf-doc-scrollable--files{overflow:hidden;display:flex;flex-direction:column}:host ::ng-deep .sf-doc-scrollable--files>lib-folder-files{flex:1;min-height:0}.iconWhatsApp{font-size:40px;color:#6495ed}.doc-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:.5rem}:host ::ng-deep .doc-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.doc-toolbar-left{flex:1;min-width:180px}.doc-toolbar-right{display:flex;justify-content:flex-end}:host ::ng-deep .doc-toolbar-right .p-button-outlined{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px}:host ::ng-deep .doc-toolbar-right .p-button-outlined:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .doc-toolbar-right .p-button-outlined:disabled{opacity:.5}@media only screen and (max-width: 656px),(max-device-width: 656px){.doc-toolbar{flex-direction:column;align-items:stretch}.doc-toolbar-right{justify-content:stretch}.doc-toolbar-right button{width:100%}}.folder-list{display:flex;flex-direction:column}.folder-item{display:flex;align-items:center;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.folder-item:hover{background-color:#f9fafb}.folder-item:last-child{border-bottom:1px solid #e5e7eb}.folder-item__icon{font-size:18px;color:#6b7280;margin-right:12px;flex-shrink:0}.folder-item__info{display:flex;flex-direction:column;flex:1;min-width:0}.folder-item__name{font-size:13.5px;font-weight:500;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.folder-item__count{font-size:12px;color:#9ca3af;margin-top:1px}.folder-item__arrow{font-size:13px;color:#9ca3af;margin-left:12px;flex-shrink:0}.buttons{display:flex;justify-content:space-around;margin-block:15px}.frameDoc{overflow:hidden;border:none}.sf-doc-excel-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:300px;text-align:center;color:#374151}.sf-doc-excel-fallback i{font-size:48px;color:#1d6f42}.buttonResponsive,buttonResponsiveBotonFinal{display:inline-block;border-radius:4px;background-color:#00f;border:none;color:#fff;text-align:center;font-size:12px;padding:10px;width:200px;transition:all .5s;cursor:pointer;margin:20px 5px 5px}.gen-form{display:flex;flex-direction:column;gap:14px}.gen-section{display:flex;flex-direction:column;gap:12px}.gen-field{display:flex;flex-direction:column;gap:6px}.gen-label{font-size:13px;font-weight:600;color:#111827}.gen-required{color:#ef4444;margin-left:4px}.gen-control{width:100%}:host ::ng-deep .gen-control .p-dropdown,:host ::ng-deep .gen-control .p-inputtext,:host ::ng-deep .gen-control .p-inputnumber,:host ::ng-deep .gen-control .p-datepicker{width:100%}:host ::ng-deep .gen-control .p-inputnumber-input{width:100%}.gen-checkbox{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px}.gen-checkbox-label{font-size:14px;color:#374151}.gen-help{color:#6b7280}\n"], dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i6$1.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "ngmodule", type: PanelModule }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i5.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: SafePipe, name: "safe" }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i6.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "component", type: FolderFilesComponent, selector: "lib-folder-files", inputs: ["carpeta", "isMobile", "idKatios", "server", "subestado", "requestData", "useBreadcrumb", "usesApi"], outputs: ["onFileChange", "onCargarArchivo", "onEliminarMasivo", "onOpenVisorDoc", "onOpenNewWindow", "onBack"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i12.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i13.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "size", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i14.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
1090
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SfDocumentsComponent, deps: [{ token: i1.DomSanitizer }, { token: i2$1.MessageService }, { token: i0.ApplicationRef }, { token: i2$1.ConfirmationService }, { token: SfDocumentsService }], target: i0.ɵɵFactoryTarget.Component });
1091
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: SfDocumentsComponent, isStandalone: true, selector: "app-sf-documents", inputs: { accion: "accion", entidad: "entidad", ndoc: "ndoc", tdoc: "tdoc", tipo: "tipo", Kasociada: "Kasociada", Producto: "Producto", Solicitud: "Solicitud", oSession: "oSession", perfilDocumentos: "perfilDocumentos", subestado: "subestado", isMobile: "isMobile", bAtras: "bAtras", bFinal: "bFinal", botones: "botones", aplFiltro: "aplFiltro", nmco: "nmco", useBreadcrumb: "useBreadcrumb", usesApi: "usesApi", allowedUploadTypes: "allowedUploadTypes", server: "server", idKatios: "idKatios" }, outputs: { nextTabPapa: "nextTabPapa", onNavigationChange: "onNavigationChange" }, providers: [ConfirmationService], viewQueries: [{ propertyName: "panel", first: true, predicate: ["pdf"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div class=\"sf-doc-layout\">\r\n <div class=\"sf-doc-fixed\">\r\n <div class=\"buttons\" *ngIf=\"botones\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Atras\"\r\n icon=\"pi pi-arrow-left\"\r\n (click)=\"next(-1)\"\r\n ></button>\r\n </div>\r\n <div\r\n class=\"div-table-col50\"\r\n style=\"text-align: center\"\r\n *ngIf=\"!bFinal && botones\"\r\n >\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Siguiente\"\r\n icon=\"pi pi-arrow-right\"\r\n (click)=\"next(1)\"\r\n ></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Finalizar\"\r\n icon=\"pi pi-home\"\r\n (click)=\"next(0)\"\r\n ></button>\r\n </div>\r\n </div>\r\n <!-- Toolbar superior (solo tab 1) -->\r\n <div *ngIf=\"tab == 1\" class=\"doc-toolbar\">\r\n <div class=\"doc-toolbar-left\" *ngIf=\"aplFiltro\">\r\n <p-iconfield>\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input\r\n type=\"text\"\r\n pInputText\r\n placeholder=\"Buscar carpeta...\"\r\n [(ngModel)]=\"valorFiltro\"\r\n (keyup)=\"filtrarDocumentos()\"\r\n class=\"w-full\"\r\n [disabled]=\"documentService.loadingData\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n\r\n <div class=\"doc-toolbar-right\" *ngIf=\"documentTypes.length > 0\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Generar documento\"\r\n icon=\"pi pi-plus\"\r\n class=\"p-button-sm\"\r\n (click)=\"openGenerateDialog()\"\r\n [disabled]=\"enProceso || !canGenerate\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n <p-confirmDialog\r\n header=\"Atencion\"\r\n icon=\"pi pi-exclamation-triangle\"\r\n ></p-confirmDialog>\r\n <div class=\"sf-doc-scrollable\" *ngIf=\"tab == 1\">\r\n <div class=\"folder-list\">\r\n @if (!documentService.loadingData) {\r\n <ng-container *ngFor=\"let carpeta of filesFilter\">\r\n <div class=\"folder-list\">\r\n <div\r\n class=\"folder-item\"\r\n *ngFor=\"let item of carpeta.children\"\r\n (click)=\"VerDetalleTab(item)\"\r\n >\r\n <i\r\n class=\"pi pi-folder folder-item__icon\"\r\n [ngStyle]=\"{\r\n color:\r\n item.children?.length > 0 || item.fileCount > 0\r\n ? 'green'\r\n : 'red',\r\n }\"\r\n ></i>\r\n <div class=\"folder-item__info\">\r\n <span class=\"folder-item__name\">{{ item.label }}</span>\r\n <span\r\n class=\"folder-item__count\"\r\n *ngIf=\"item.children?.length > 0\"\r\n >{{ item.children.length }}\r\n {{\r\n item.children.length === 1 ? \"archivo\" : \"archivos\"\r\n }}</span\r\n >\r\n <span\r\n class=\"folder-item__count\"\r\n *ngIf=\"\r\n (!item.children || item.children.length === 0) &&\r\n item.fileCount\r\n \"\r\n >{{ item.fileCount }}\r\n {{ item.fileCount === 1 ? \"archivo\" : \"archivos\" }}</span\r\n >\r\n <span\r\n class=\"folder-item__count\"\r\n *ngIf=\"\r\n (!item.children || item.children.length === 0) &&\r\n !item.fileCount\r\n \"\r\n >0 archivos</span\r\n >\r\n </div>\r\n <i class=\"pi pi-chevron-right folder-item__arrow\"></i>\r\n </div>\r\n </div>\r\n </ng-container>\r\n } @else {\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <ng-container *ngIf=\"botones\">\r\n <div class=\"buttons\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Atras\"\r\n icon=\"pi pi-arrow-left\"\r\n (click)=\"next(-1)\"\r\n ></button>\r\n </div>\r\n <div\r\n class=\"div-table-col50\"\r\n style=\"text-align: center\"\r\n *ngIf=\"!bFinal && botones\"\r\n >\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Siguiente\"\r\n icon=\"pi pi-arrow-right\"\r\n (click)=\"next(1)\"\r\n ></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Finalizar\"\r\n icon=\"pi pi-home\"\r\n (click)=\"next(0)\"\r\n ></button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"sf-doc-scrollable sf-doc-scrollable--files\" *ngIf=\"tab == 2\">\r\n <lib-folder-files\r\n [carpeta]=\"carpetaSeleccionada\"\r\n [isMobile]=\"isMobile\"\r\n [idKatios]=\"idKatios\"\r\n [server]=\"server\"\r\n [subestado]=\"subestado\"\r\n [requestData]=\"requestData\"\r\n [useBreadcrumb]=\"useBreadcrumb\"\r\n [usesApi]=\"usesApi\"\r\n [allowedUploadTypes]=\"allowedUploadTypes\"\r\n (onFileChange)=\"fileChange($event)\"\r\n (onCargarArchivo)=\"cargarArchivo($event)\"\r\n (onEliminarMasivo)=\"eliminarMasivo($event)\"\r\n (onBack)=\"goToTab('1')\"\r\n >\r\n </lib-folder-files>\r\n </div>\r\n</div>\r\n\r\n<!-- <ng-template #scanContent>\r\n <div class=\"div-table\">\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <h4>Escanear documentos</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n Archivos cargados: <h4>{{scanFileList.length}}</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <label (click)=\"takePhotoClick()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">add_to_photos</mat-icon>\r\n </label>\r\n\r\n <label *ngIf=\"scanFileList.length != 0\" (click)=\"subirFotosScan()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">share</mat-icon>\r\n </label>\r\n </div>\r\n </div>\r\n</ng-template> -->\r\n<p-dialog\r\n header=\"Generar documento\"\r\n [(visible)]=\"displayGenerate\"\r\n [modal]=\"true\"\r\n [closable]=\"true\"\r\n [style]=\"{ width: isMobile ? '95vw' : '520px' }\"\r\n>\r\n <div class=\"gen-form\">\r\n <!-- Tipo de documento -->\r\n <div class=\"gen-field\">\r\n <label class=\"gen-label\">Tipo de documento</label>\r\n <p-dropdown\r\n class=\"gen-control\"\r\n [options]=\"documentTypes\"\r\n optionLabel=\"label\"\r\n optionValue=\"code\"\r\n [(ngModel)]=\"selectedDocType\"\r\n placeholder=\"Seleccione un tipo\"\r\n appendTo=\"body\"\r\n (onChange)=\"onDocTypeChange()\"\r\n >\r\n </p-dropdown>\r\n </div>\r\n\r\n <!-- Par\u00E1metros din\u00E1micos -->\r\n <div class=\"gen-section\" *ngIf=\"dynamicParams.length\">\r\n <div class=\"gen-field\" *ngFor=\"let p of dynamicParams\">\r\n <label class=\"gen-label\">\r\n {{ p.description }}\r\n <span class=\"gen-required\" *ngIf=\"p.required\">*</span>\r\n </label>\r\n\r\n <!-- Date -->\r\n <p-datepicker\r\n *ngIf=\"(p.type || '').toLowerCase() === 'date'\"\r\n class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\"\r\n [showIcon]=\"true\"\r\n appendTo=\"body\"\r\n dateFormat=\"yy-mm-dd\"\r\n >\r\n </p-datepicker>\r\n\r\n <!-- String -->\r\n <input\r\n *ngIf=\"\r\n (p.type || '').toLowerCase() === 'nvarchar' ||\r\n (p.type || '').toLowerCase() === 'string'\r\n \"\r\n pInputText\r\n class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\"\r\n placeholder=\"Ingrese un valor\"\r\n />\r\n\r\n <!-- Number -->\r\n <p-inputNumber\r\n *ngIf=\"\r\n ['int', 'decimal', 'number'].includes((p.type || '').toLowerCase())\r\n \"\r\n class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\"\r\n >\r\n </p-inputNumber>\r\n\r\n <!-- Boolean -->\r\n <div\r\n class=\"gen-control gen-checkbox\"\r\n *ngIf=\"\r\n ['boolean', 'bit', 'bool'].includes((p.type || '').toLowerCase())\r\n \"\r\n >\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"dynamicValues[p.name]\">\r\n </p-checkbox>\r\n <span class=\"gen-checkbox-label\">S\u00ED</span>\r\n </div>\r\n\r\n <!-- helper opcional -->\r\n <small class=\"gen-help\" *ngIf=\"p.help\">{{ p.help }}</small>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-template pTemplate=\"footer\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Cancelar\"\r\n class=\"p-button-text\"\r\n (click)=\"displayGenerate = false\"\r\n ></button>\r\n\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Generar\"\r\n icon=\"pi pi-cog\"\r\n (click)=\"generateDocument()\"\r\n [disabled]=\"!selectedDocType || enProceso\"\r\n ></button>\r\n </ng-template>\r\n</p-dialog>\r\n", styles: [":host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-fixed{flex-shrink:0}.sf-doc-scrollable{flex:1;min-height:0;overflow-y:auto}.sf-doc-scrollable--files{overflow:hidden;display:flex;flex-direction:column}:host ::ng-deep .sf-doc-scrollable--files>lib-folder-files{flex:1;min-height:0}.iconWhatsApp{font-size:40px;color:#6495ed}.doc-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:.5rem}:host ::ng-deep .doc-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.doc-toolbar-left{flex:1;min-width:180px}.doc-toolbar-right{display:flex;justify-content:flex-end}:host ::ng-deep .doc-toolbar-right .p-button-outlined{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px}:host ::ng-deep .doc-toolbar-right .p-button-outlined:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .doc-toolbar-right .p-button-outlined:disabled{opacity:.5}@media only screen and (max-width: 656px),(max-device-width: 656px){.doc-toolbar{flex-direction:column;align-items:stretch}.doc-toolbar-right{justify-content:stretch}.doc-toolbar-right button{width:100%}}.folder-list{display:flex;flex-direction:column}.folder-item{display:flex;align-items:center;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.folder-item:hover{background-color:#f9fafb}.folder-item:last-child{border-bottom:1px solid #e5e7eb}.folder-item__icon{font-size:18px;color:#6b7280;margin-right:12px;flex-shrink:0}.folder-item__info{display:flex;flex-direction:column;flex:1;min-width:0}.folder-item__name{font-size:13.5px;font-weight:500;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.folder-item__count{font-size:12px;color:#9ca3af;margin-top:1px}.folder-item__arrow{font-size:13px;color:#9ca3af;margin-left:12px;flex-shrink:0}.buttons{display:flex;justify-content:space-around;margin-block:15px}.buttonResponsive,buttonResponsiveBotonFinal{display:inline-block;border-radius:4px;background-color:#00f;border:none;color:#fff;text-align:center;font-size:12px;padding:10px;width:200px;transition:all .5s;cursor:pointer;margin:20px 5px 5px}.gen-form{display:flex;flex-direction:column;gap:14px}.gen-section{display:flex;flex-direction:column;gap:12px}.gen-field{display:flex;flex-direction:column;gap:6px}.gen-label{font-size:13px;font-weight:600;color:#111827}.gen-required{color:#ef4444;margin-left:4px}.gen-control{width:100%}:host ::ng-deep .gen-control .p-dropdown,:host ::ng-deep .gen-control .p-inputtext,:host ::ng-deep .gen-control .p-inputnumber,:host ::ng-deep .gen-control .p-datepicker{width:100%}:host ::ng-deep .gen-control .p-inputnumber-input{width:100%}.gen-checkbox{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px}.gen-checkbox-label{font-size:14px;color:#374151}.gen-help{color:#6b7280}\n"], dependencies: [{ kind: "ngmodule", type: ToastModule }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i1$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i5$1.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "ngmodule", type: PanelModule }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i8.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "component", type: FolderFilesComponent, selector: "lib-folder-files", inputs: ["carpeta", "isMobile", "idKatios", "server", "subestado", "requestData", "useBreadcrumb", "usesApi", "allowedUploadTypes"], outputs: ["onFileChange", "onCargarArchivo", "onEliminarMasivo", "onBack"] }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i11.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i12.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "size", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i13.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
1045
1092
  }
1046
1093
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SfDocumentsComponent, decorators: [{
1047
1094
  type: Component,
1048
1095
  args: [{ selector: 'app-sf-documents', imports: [
1049
- ToastModule, ButtonModule, ConfirmDialogModule, PanelModule, CheckboxModule,
1050
- DialogModule, CommonModule, FormsModule, SafePipe, InputTextModule, InputIcon,
1051
- IconField, FolderFilesComponent,
1052
- DropdownModule, DatePickerModule, SkeletonModule
1053
- ], providers: [DialogService, ConfirmationService], standalone: true, template: "<div class=\"sf-doc-layout\">\r\n <div class=\"sf-doc-fixed\">\r\n <div class=\"buttons\" *ngIf=\"botones\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button pButton type=\"button\" label=\"Atras\" icon=\"pi pi-arrow-left\" (click)=\"next(-1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"!bFinal && botones\">\r\n <button pButton type=\"button\" label=\"Siguiente\" icon=\"pi pi-arrow-right\" (click)=\"next(1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button pButton type=\"button\" label=\"Finalizar\" icon=\"pi pi-home\" (click)=\"next(0)\"></button>\r\n </div>\r\n </div>\r\n <!-- Toolbar superior (solo tab 1) -->\r\n <div *ngIf=\"tab==1\" class=\"doc-toolbar\">\r\n <div class=\"doc-toolbar-left\" *ngIf=\"aplFiltro\">\r\n <p-iconfield>\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input type=\"text\" pInputText placeholder=\"Buscar carpeta...\" [(ngModel)]=\"valorFiltro\"\r\n (keyup)=\"filtrarDocumentos()\" class=\"w-full\" [disabled]=\"documentService.loadingData\">\r\n </p-iconfield>\r\n </div>\r\n\r\n <div class=\"doc-toolbar-right\" *ngIf=\"(documentTypes.length > 0)\">\r\n <button pButton type=\"button\" label=\"Generar documento\" icon=\"pi pi-plus\" class=\"p-button-sm\"\r\n (click)=\"openGenerateDialog()\" [disabled]=\"enProceso || !canGenerate\">\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <p-confirmDialog header=\"Atencion\" icon=\"pi pi-exclamation-triangle\"></p-confirmDialog>\r\n <div class=\"sf-doc-scrollable\" *ngIf=\"tab==1\">\r\n <div class=\"folder-list\">\r\n @if(!documentService.loadingData){\r\n <ng-container *ngFor=\"let carpeta of filesFilter\">\r\n <div class=\"folder-list\">\r\n <div class=\"folder-item\" *ngFor=\"let item of carpeta.children\" (click)=\"VerDetalleTab(item)\">\r\n <i class=\"pi pi-folder folder-item__icon\"\r\n [ngStyle]=\"{'color': (item.children?.length > 0 || item.fileCount > 0) ? 'green':'red' }\"></i>\r\n <div class=\"folder-item__info\">\r\n <span class=\"folder-item__name\">{{item.label}}</span>\r\n <span class=\"folder-item__count\" *ngIf=\"item.children?.length > 0\">{{item.children.length}}\r\n {{item.children.length === 1 ? 'archivo' : 'archivos'}}</span>\r\n <span class=\"folder-item__count\"\r\n *ngIf=\"(!item.children || item.children.length === 0) && item.fileCount\">{{item.fileCount}}\r\n {{item.fileCount === 1 ? 'archivo' : 'archivos'}}</span>\r\n <span class=\"folder-item__count\"\r\n *ngIf=\"(!item.children || item.children.length === 0) && !item.fileCount\">0\r\n archivos</span>\r\n </div>\r\n <i class=\"pi pi-chevron-right folder-item__arrow\"></i>\r\n </div>\r\n </div>\r\n </ng-container>\r\n }\r\n @else{\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <ng-container *ngIf=\"botones\">\r\n <div class=\"buttons\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button pButton type=\"button\" label=\"Atras\" icon=\"pi pi-arrow-left\" (click)=\"next(-1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"!bFinal && botones\">\r\n <button pButton type=\"button\" label=\"Siguiente\" icon=\"pi pi-arrow-right\" (click)=\"next(1)\"></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button pButton type=\"button\" label=\"Finalizar\" icon=\"pi pi-home\" (click)=\"next(0)\"></button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"sf-doc-scrollable sf-doc-scrollable--files\" *ngIf=\"tab==2\">\r\n <lib-folder-files [carpeta]=\"carpetaSeleccionada\" [isMobile]=\"isMobile\" [idKatios]=\"idKatios\" [server]=\"server\"\r\n [subestado]=\"subestado\" [requestData]=\"requestData\" [useBreadcrumb]=\"useBreadcrumb\" [usesApi]=\"usesApi\"\r\n (onFileChange)=\"fileChange($event)\" (onCargarArchivo)=\"cargarArchivo($event)\"\r\n (onOpenVisorDoc)=\"openVisorDoc($event)\" (onOpenNewWindow)=\"openNewWindow($event)\"\r\n (onEliminarMasivo)=\"eliminarMasivo($event)\" (onBack)=\"goToTab('1')\">\r\n </lib-folder-files>\r\n </div>\r\n</div>\r\n\r\n<p-dialog *ngIf=\"displayPDF\" [(visible)]=\"displayPDF\"\r\n header=\"{{current_label.replace('#toolbar=0&navpanes=0&statusbar=0','')}}\" [modal]=\"true\" [style]=\"{width: '70vw'}\">\r\n <div *ngIf=\"isCurrentExcel()\" class=\"sf-doc-excel-fallback\">\r\n <i class=\"pi pi-file-excel\"></i>\r\n <p>La vista previa no est\u00E1 disponible para archivos de Excel.</p>\r\n <button pButton type=\"button\" label=\"Abrir en una nueva ventana\" icon=\"pi pi-external-link\"\r\n (click)=\"openCurrentInNewWindow()\"></button>\r\n </div>\r\n <ng-container *ngIf=\"!isCurrentExcel()\">\r\n <embed *ngIf=\"carpetaSeleccionada.TipoArchivo == '2'\" [src]=\"current_path | safe\"\r\n style=\"width:100%; min-height: 600px\">\r\n <iframe *ngIf=\"carpetaSeleccionada.TipoArchivo == '1'\" style=\"width:100%; min-height: 600px\"\r\n [src]=\"current_path | safe\"></iframe>\r\n </ng-container>\r\n</p-dialog>\r\n\r\n\r\n<ng-template #pdfContent>\r\n <div class=\"modal-header\">\r\n <h4 class=\"modal-title\" id=\"modal-basic-title\">{{current_label.replace('#toolbar=0&navpanes=0&statusbar=0','')}}\r\n </h4>\r\n <button type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"modalReference?.close()\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>\r\n <div>\r\n <div *ngIf=\"isCurrentExcel()\" class=\"sf-doc-excel-fallback\">\r\n <i class=\"pi pi-file-excel\"></i>\r\n <p>La vista previa no est\u00E1 disponible para archivos de Excel.</p>\r\n <button pButton type=\"button\" label=\"Abrir en una nueva ventana\" icon=\"pi pi-external-link\"\r\n (click)=\"openCurrentInNewWindow()\"></button>\r\n </div>\r\n <ng-container *ngIf=\"!isCurrentExcel()\">\r\n <embed *ngIf=\"carpetaSeleccionada.TipoArchivo == '2'\" [src]=\"current_path | safe\"\r\n style=\"width:100%; min-height: 600px\">\r\n <iframe *ngIf=\"carpetaSeleccionada.TipoArchivo == '1'\" style=\"width:100%; min-height: 600px\"\r\n [src]=\"current_path | safe\"></iframe>\r\n </ng-container>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- <ng-template #scanContent>\r\n <div class=\"div-table\">\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <h4>Escanear documentos</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n Archivos cargados: <h4>{{scanFileList.length}}</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <label (click)=\"takePhotoClick()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">add_to_photos</mat-icon>\r\n </label>\r\n\r\n <label *ngIf=\"scanFileList.length != 0\" (click)=\"subirFotosScan()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">share</mat-icon>\r\n </label>\r\n </div>\r\n </div>\r\n</ng-template> -->\r\n<p-dialog header=\"Generar documento\" [(visible)]=\"displayGenerate\" [modal]=\"true\" [closable]=\"true\"\r\n [style]=\"{width: isMobile ? '95vw' : '520px'}\">\r\n\r\n <div class=\"gen-form\">\r\n <!-- Tipo de documento -->\r\n <div class=\"gen-field\">\r\n <label class=\"gen-label\">Tipo de documento</label>\r\n <p-dropdown class=\"gen-control\" [options]=\"documentTypes\" optionLabel=\"label\" optionValue=\"code\"\r\n [(ngModel)]=\"selectedDocType\" placeholder=\"Seleccione un tipo\" appendTo=\"body\" (onChange)=\"onDocTypeChange()\">\r\n </p-dropdown>\r\n </div>\r\n\r\n <!-- Par\u00E1metros din\u00E1micos -->\r\n <div class=\"gen-section\" *ngIf=\"dynamicParams.length\">\r\n <div class=\"gen-field\" *ngFor=\"let p of dynamicParams\">\r\n <label class=\"gen-label\">\r\n {{ p.description }}\r\n <span class=\"gen-required\" *ngIf=\"p.required\">*</span>\r\n </label>\r\n\r\n <!-- Date -->\r\n <p-datepicker *ngIf=\"(p.type || '').toLowerCase() === 'date'\" class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\" [showIcon]=\"true\" appendTo=\"body\" dateFormat=\"yy-mm-dd\">\r\n </p-datepicker>\r\n\r\n <!-- String -->\r\n <input *ngIf=\"(p.type || '').toLowerCase() === 'nvarchar' || (p.type || '').toLowerCase() === 'string'\"\r\n pInputText class=\"gen-control\" [(ngModel)]=\"dynamicValues[p.name]\" placeholder=\"Ingrese un valor\" />\r\n\r\n <!-- Number -->\r\n <p-inputNumber *ngIf=\"['int','decimal','number'].includes((p.type || '').toLowerCase())\" class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\">\r\n </p-inputNumber>\r\n\r\n <!-- Boolean -->\r\n <div class=\"gen-control gen-checkbox\" *ngIf=\"['boolean','bit','bool'].includes((p.type || '').toLowerCase())\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"dynamicValues[p.name]\">\r\n </p-checkbox>\r\n <span class=\"gen-checkbox-label\">S\u00ED</span>\r\n </div>\r\n\r\n <!-- helper opcional -->\r\n <small class=\"gen-help\" *ngIf=\"p.help\">{{ p.help }}</small>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-template pTemplate=\"footer\">\r\n <button pButton type=\"button\" label=\"Cancelar\" class=\"p-button-text\" (click)=\"displayGenerate=false\"></button>\r\n\r\n <button pButton type=\"button\" label=\"Generar\" icon=\"pi pi-cog\" (click)=\"generateDocument()\"\r\n [disabled]=\"!selectedDocType || enProceso\">\r\n </button>\r\n </ng-template>\r\n</p-dialog>", styles: [":host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-fixed{flex-shrink:0}.sf-doc-scrollable{flex:1;min-height:0;overflow-y:auto}.sf-doc-scrollable--files{overflow:hidden;display:flex;flex-direction:column}:host ::ng-deep .sf-doc-scrollable--files>lib-folder-files{flex:1;min-height:0}.iconWhatsApp{font-size:40px;color:#6495ed}.doc-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:.5rem}:host ::ng-deep .doc-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.doc-toolbar-left{flex:1;min-width:180px}.doc-toolbar-right{display:flex;justify-content:flex-end}:host ::ng-deep .doc-toolbar-right .p-button-outlined{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px}:host ::ng-deep .doc-toolbar-right .p-button-outlined:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .doc-toolbar-right .p-button-outlined:disabled{opacity:.5}@media only screen and (max-width: 656px),(max-device-width: 656px){.doc-toolbar{flex-direction:column;align-items:stretch}.doc-toolbar-right{justify-content:stretch}.doc-toolbar-right button{width:100%}}.folder-list{display:flex;flex-direction:column}.folder-item{display:flex;align-items:center;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.folder-item:hover{background-color:#f9fafb}.folder-item:last-child{border-bottom:1px solid #e5e7eb}.folder-item__icon{font-size:18px;color:#6b7280;margin-right:12px;flex-shrink:0}.folder-item__info{display:flex;flex-direction:column;flex:1;min-width:0}.folder-item__name{font-size:13.5px;font-weight:500;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.folder-item__count{font-size:12px;color:#9ca3af;margin-top:1px}.folder-item__arrow{font-size:13px;color:#9ca3af;margin-left:12px;flex-shrink:0}.buttons{display:flex;justify-content:space-around;margin-block:15px}.frameDoc{overflow:hidden;border:none}.sf-doc-excel-fallback{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:300px;text-align:center;color:#374151}.sf-doc-excel-fallback i{font-size:48px;color:#1d6f42}.buttonResponsive,buttonResponsiveBotonFinal{display:inline-block;border-radius:4px;background-color:#00f;border:none;color:#fff;text-align:center;font-size:12px;padding:10px;width:200px;transition:all .5s;cursor:pointer;margin:20px 5px 5px}.gen-form{display:flex;flex-direction:column;gap:14px}.gen-section{display:flex;flex-direction:column;gap:12px}.gen-field{display:flex;flex-direction:column;gap:6px}.gen-label{font-size:13px;font-weight:600;color:#111827}.gen-required{color:#ef4444;margin-left:4px}.gen-control{width:100%}:host ::ng-deep .gen-control .p-dropdown,:host ::ng-deep .gen-control .p-inputtext,:host ::ng-deep .gen-control .p-inputnumber,:host ::ng-deep .gen-control .p-datepicker{width:100%}:host ::ng-deep .gen-control .p-inputnumber-input{width:100%}.gen-checkbox{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px}.gen-checkbox-label{font-size:14px;color:#374151}.gen-help{color:#6b7280}\n"] }]
1054
- }], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: i2$1.DialogService }, { type: i3$1.MessageService }, { type: i0.ApplicationRef }, { type: i3$1.ConfirmationService }, { type: SfDocumentsService }], propDecorators: { accion: [{
1096
+ ToastModule,
1097
+ ButtonModule,
1098
+ ConfirmDialogModule,
1099
+ PanelModule,
1100
+ CheckboxModule,
1101
+ DialogModule,
1102
+ CommonModule,
1103
+ FormsModule,
1104
+ SafePipe,
1105
+ InputTextModule,
1106
+ InputIcon,
1107
+ IconField,
1108
+ FolderFilesComponent,
1109
+ DropdownModule,
1110
+ DatePickerModule,
1111
+ SkeletonModule,
1112
+ ], providers: [ConfirmationService], standalone: true, template: "<div class=\"sf-doc-layout\">\r\n <div class=\"sf-doc-fixed\">\r\n <div class=\"buttons\" *ngIf=\"botones\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Atras\"\r\n icon=\"pi pi-arrow-left\"\r\n (click)=\"next(-1)\"\r\n ></button>\r\n </div>\r\n <div\r\n class=\"div-table-col50\"\r\n style=\"text-align: center\"\r\n *ngIf=\"!bFinal && botones\"\r\n >\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Siguiente\"\r\n icon=\"pi pi-arrow-right\"\r\n (click)=\"next(1)\"\r\n ></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Finalizar\"\r\n icon=\"pi pi-home\"\r\n (click)=\"next(0)\"\r\n ></button>\r\n </div>\r\n </div>\r\n <!-- Toolbar superior (solo tab 1) -->\r\n <div *ngIf=\"tab == 1\" class=\"doc-toolbar\">\r\n <div class=\"doc-toolbar-left\" *ngIf=\"aplFiltro\">\r\n <p-iconfield>\r\n <p-inputicon class=\"pi pi-search\" />\r\n <input\r\n type=\"text\"\r\n pInputText\r\n placeholder=\"Buscar carpeta...\"\r\n [(ngModel)]=\"valorFiltro\"\r\n (keyup)=\"filtrarDocumentos()\"\r\n class=\"w-full\"\r\n [disabled]=\"documentService.loadingData\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n\r\n <div class=\"doc-toolbar-right\" *ngIf=\"documentTypes.length > 0\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Generar documento\"\r\n icon=\"pi pi-plus\"\r\n class=\"p-button-sm\"\r\n (click)=\"openGenerateDialog()\"\r\n [disabled]=\"enProceso || !canGenerate\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n <p-confirmDialog\r\n header=\"Atencion\"\r\n icon=\"pi pi-exclamation-triangle\"\r\n ></p-confirmDialog>\r\n <div class=\"sf-doc-scrollable\" *ngIf=\"tab == 1\">\r\n <div class=\"folder-list\">\r\n @if (!documentService.loadingData) {\r\n <ng-container *ngFor=\"let carpeta of filesFilter\">\r\n <div class=\"folder-list\">\r\n <div\r\n class=\"folder-item\"\r\n *ngFor=\"let item of carpeta.children\"\r\n (click)=\"VerDetalleTab(item)\"\r\n >\r\n <i\r\n class=\"pi pi-folder folder-item__icon\"\r\n [ngStyle]=\"{\r\n color:\r\n item.children?.length > 0 || item.fileCount > 0\r\n ? 'green'\r\n : 'red',\r\n }\"\r\n ></i>\r\n <div class=\"folder-item__info\">\r\n <span class=\"folder-item__name\">{{ item.label }}</span>\r\n <span\r\n class=\"folder-item__count\"\r\n *ngIf=\"item.children?.length > 0\"\r\n >{{ item.children.length }}\r\n {{\r\n item.children.length === 1 ? \"archivo\" : \"archivos\"\r\n }}</span\r\n >\r\n <span\r\n class=\"folder-item__count\"\r\n *ngIf=\"\r\n (!item.children || item.children.length === 0) &&\r\n item.fileCount\r\n \"\r\n >{{ item.fileCount }}\r\n {{ item.fileCount === 1 ? \"archivo\" : \"archivos\" }}</span\r\n >\r\n <span\r\n class=\"folder-item__count\"\r\n *ngIf=\"\r\n (!item.children || item.children.length === 0) &&\r\n !item.fileCount\r\n \"\r\n >0 archivos</span\r\n >\r\n </div>\r\n <i class=\"pi pi-chevron-right folder-item__arrow\"></i>\r\n </div>\r\n </div>\r\n </ng-container>\r\n } @else {\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n <div class=\"folder-item\">\r\n <p-skeleton shape=\"circle\" size=\"2rem\" styleClass=\"mr-2\" />\r\n <div class=\"self-center\" style=\"flex: 1\">\r\n <p-skeleton width=\"100%\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"75%\" />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n <ng-container *ngIf=\"botones\">\r\n <div class=\"buttons\">\r\n <div class=\"div-table-col50\" style=\"text-align: center\" *ngIf=\"bAtras\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Atras\"\r\n icon=\"pi pi-arrow-left\"\r\n (click)=\"next(-1)\"\r\n ></button>\r\n </div>\r\n <div\r\n class=\"div-table-col50\"\r\n style=\"text-align: center\"\r\n *ngIf=\"!bFinal && botones\"\r\n >\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Siguiente\"\r\n icon=\"pi pi-arrow-right\"\r\n (click)=\"next(1)\"\r\n ></button>\r\n </div>\r\n <div class=\"div-table-col50\" *ngIf=\"bFinal\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Finalizar\"\r\n icon=\"pi pi-home\"\r\n (click)=\"next(0)\"\r\n ></button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"sf-doc-scrollable sf-doc-scrollable--files\" *ngIf=\"tab == 2\">\r\n <lib-folder-files\r\n [carpeta]=\"carpetaSeleccionada\"\r\n [isMobile]=\"isMobile\"\r\n [idKatios]=\"idKatios\"\r\n [server]=\"server\"\r\n [subestado]=\"subestado\"\r\n [requestData]=\"requestData\"\r\n [useBreadcrumb]=\"useBreadcrumb\"\r\n [usesApi]=\"usesApi\"\r\n [allowedUploadTypes]=\"allowedUploadTypes\"\r\n (onFileChange)=\"fileChange($event)\"\r\n (onCargarArchivo)=\"cargarArchivo($event)\"\r\n (onEliminarMasivo)=\"eliminarMasivo($event)\"\r\n (onBack)=\"goToTab('1')\"\r\n >\r\n </lib-folder-files>\r\n </div>\r\n</div>\r\n\r\n<!-- <ng-template #scanContent>\r\n <div class=\"div-table\">\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <h4>Escanear documentos</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n Archivos cargados: <h4>{{scanFileList.length}}</h4>\r\n </div>\r\n <div class=\"div-table-row\" style=\"text-align: center\">\r\n <label (click)=\"takePhotoClick()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">add_to_photos</mat-icon>\r\n </label>\r\n\r\n <label *ngIf=\"scanFileList.length != 0\" (click)=\"subirFotosScan()\" class=\"btn\">\r\n <mat-icon style=\"font-size: 2.5em; color:#0056b2\">share</mat-icon>\r\n </label>\r\n </div>\r\n </div>\r\n</ng-template> -->\r\n<p-dialog\r\n header=\"Generar documento\"\r\n [(visible)]=\"displayGenerate\"\r\n [modal]=\"true\"\r\n [closable]=\"true\"\r\n [style]=\"{ width: isMobile ? '95vw' : '520px' }\"\r\n>\r\n <div class=\"gen-form\">\r\n <!-- Tipo de documento -->\r\n <div class=\"gen-field\">\r\n <label class=\"gen-label\">Tipo de documento</label>\r\n <p-dropdown\r\n class=\"gen-control\"\r\n [options]=\"documentTypes\"\r\n optionLabel=\"label\"\r\n optionValue=\"code\"\r\n [(ngModel)]=\"selectedDocType\"\r\n placeholder=\"Seleccione un tipo\"\r\n appendTo=\"body\"\r\n (onChange)=\"onDocTypeChange()\"\r\n >\r\n </p-dropdown>\r\n </div>\r\n\r\n <!-- Par\u00E1metros din\u00E1micos -->\r\n <div class=\"gen-section\" *ngIf=\"dynamicParams.length\">\r\n <div class=\"gen-field\" *ngFor=\"let p of dynamicParams\">\r\n <label class=\"gen-label\">\r\n {{ p.description }}\r\n <span class=\"gen-required\" *ngIf=\"p.required\">*</span>\r\n </label>\r\n\r\n <!-- Date -->\r\n <p-datepicker\r\n *ngIf=\"(p.type || '').toLowerCase() === 'date'\"\r\n class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\"\r\n [showIcon]=\"true\"\r\n appendTo=\"body\"\r\n dateFormat=\"yy-mm-dd\"\r\n >\r\n </p-datepicker>\r\n\r\n <!-- String -->\r\n <input\r\n *ngIf=\"\r\n (p.type || '').toLowerCase() === 'nvarchar' ||\r\n (p.type || '').toLowerCase() === 'string'\r\n \"\r\n pInputText\r\n class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\"\r\n placeholder=\"Ingrese un valor\"\r\n />\r\n\r\n <!-- Number -->\r\n <p-inputNumber\r\n *ngIf=\"\r\n ['int', 'decimal', 'number'].includes((p.type || '').toLowerCase())\r\n \"\r\n class=\"gen-control\"\r\n [(ngModel)]=\"dynamicValues[p.name]\"\r\n >\r\n </p-inputNumber>\r\n\r\n <!-- Boolean -->\r\n <div\r\n class=\"gen-control gen-checkbox\"\r\n *ngIf=\"\r\n ['boolean', 'bit', 'bool'].includes((p.type || '').toLowerCase())\r\n \"\r\n >\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"dynamicValues[p.name]\">\r\n </p-checkbox>\r\n <span class=\"gen-checkbox-label\">S\u00ED</span>\r\n </div>\r\n\r\n <!-- helper opcional -->\r\n <small class=\"gen-help\" *ngIf=\"p.help\">{{ p.help }}</small>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-template pTemplate=\"footer\">\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Cancelar\"\r\n class=\"p-button-text\"\r\n (click)=\"displayGenerate = false\"\r\n ></button>\r\n\r\n <button\r\n pButton\r\n type=\"button\"\r\n label=\"Generar\"\r\n icon=\"pi pi-cog\"\r\n (click)=\"generateDocument()\"\r\n [disabled]=\"!selectedDocType || enProceso\"\r\n ></button>\r\n </ng-template>\r\n</p-dialog>\r\n", styles: [":host{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-layout{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.sf-doc-fixed{flex-shrink:0}.sf-doc-scrollable{flex:1;min-height:0;overflow-y:auto}.sf-doc-scrollable--files{overflow:hidden;display:flex;flex-direction:column}:host ::ng-deep .sf-doc-scrollable--files>lib-folder-files{flex:1;min-height:0}.iconWhatsApp{font-size:40px;color:#6495ed}.doc-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:.5rem}:host ::ng-deep .doc-toolbar .p-inputtext{padding:.45rem .65rem .45rem 2.5rem;font-size:13px}.doc-toolbar-left{flex:1;min-width:180px}.doc-toolbar-right{display:flex;justify-content:flex-end}:host ::ng-deep .doc-toolbar-right .p-button-outlined{background:transparent;border:1px solid #d1d5db;color:#374151;font-weight:500;font-size:13px}:host ::ng-deep .doc-toolbar-right .p-button-outlined:hover{background:#f9fafb;border-color:#9ca3af}:host ::ng-deep .doc-toolbar-right .p-button-outlined:disabled{opacity:.5}@media only screen and (max-width: 656px),(max-device-width: 656px){.doc-toolbar{flex-direction:column;align-items:stretch}.doc-toolbar-right{justify-content:stretch}.doc-toolbar-right button{width:100%}}.folder-list{display:flex;flex-direction:column}.folder-item{display:flex;align-items:center;padding:12px 8px;border-bottom:1px solid #e5e7eb;cursor:pointer;transition:background-color .15s ease}.folder-item:hover{background-color:#f9fafb}.folder-item:last-child{border-bottom:1px solid #e5e7eb}.folder-item__icon{font-size:18px;color:#6b7280;margin-right:12px;flex-shrink:0}.folder-item__info{display:flex;flex-direction:column;flex:1;min-width:0}.folder-item__name{font-size:13.5px;font-weight:500;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.folder-item__count{font-size:12px;color:#9ca3af;margin-top:1px}.folder-item__arrow{font-size:13px;color:#9ca3af;margin-left:12px;flex-shrink:0}.buttons{display:flex;justify-content:space-around;margin-block:15px}.buttonResponsive,buttonResponsiveBotonFinal{display:inline-block;border-radius:4px;background-color:#00f;border:none;color:#fff;text-align:center;font-size:12px;padding:10px;width:200px;transition:all .5s;cursor:pointer;margin:20px 5px 5px}.gen-form{display:flex;flex-direction:column;gap:14px}.gen-section{display:flex;flex-direction:column;gap:12px}.gen-field{display:flex;flex-direction:column;gap:6px}.gen-label{font-size:13px;font-weight:600;color:#111827}.gen-required{color:#ef4444;margin-left:4px}.gen-control{width:100%}:host ::ng-deep .gen-control .p-dropdown,:host ::ng-deep .gen-control .p-inputtext,:host ::ng-deep .gen-control .p-inputnumber,:host ::ng-deep .gen-control .p-datepicker{width:100%}:host ::ng-deep .gen-control .p-inputnumber-input{width:100%}.gen-checkbox{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px}.gen-checkbox-label{font-size:14px;color:#374151}.gen-help{color:#6b7280}\n"] }]
1113
+ }], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: i2$1.MessageService }, { type: i0.ApplicationRef }, { type: i2$1.ConfirmationService }, { type: SfDocumentsService }], propDecorators: { accion: [{
1055
1114
  type: Input
1056
1115
  }], entidad: [{
1057
1116
  type: Input
@@ -1091,6 +1150,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
1091
1150
  type: Input
1092
1151
  }], usesApi: [{
1093
1152
  type: Input
1153
+ }], allowedUploadTypes: [{
1154
+ type: Input
1094
1155
  }], onNavigationChange: [{
1095
1156
  type: Output
1096
1157
  }], server: [{