sf-documents 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/sf-documents.mjs +338 -259
- package/fesm2022/sf-documents.mjs.map +1 -1
- package/lib/components/dialog/upload-dialog/upload-dialog.component.d.ts +5 -4
- package/lib/components/folder-files/folder-files.component.d.ts +11 -8
- package/lib/sf-documents.component.d.ts +13 -19
- package/lib/utils/file-type.util.d.ts +15 -5
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
13
|
+
import * as i4 from 'primeng/checkbox';
|
|
16
14
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
17
|
-
import * as
|
|
15
|
+
import * as i7$1 from 'primeng/dialog';
|
|
18
16
|
import { DialogModule } from 'primeng/dialog';
|
|
19
|
-
import * as
|
|
20
|
-
import { CommonModule, DatePipe } from '@angular/common';
|
|
21
|
-
import * as
|
|
17
|
+
import * as i8 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
|
|
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
|
|
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
|
|
29
|
+
import * as i7 from 'primeng/select';
|
|
32
30
|
import { SelectModule } from 'primeng/select';
|
|
33
|
-
import
|
|
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
|
|
34
|
+
import * as i12 from 'primeng/datepicker';
|
|
36
35
|
import { DatePickerModule } from 'primeng/datepicker';
|
|
37
|
-
import * as
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
];
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
99
|
-
|
|
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
|
-
|
|
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
|
-
|
|
114
|
-
this.
|
|
115
|
-
|
|
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
|
|
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
|
|
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,12 +267,13 @@ 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();
|
|
276
|
+
viewDocument = new EventEmitter();
|
|
224
277
|
items = [];
|
|
225
278
|
page = 1;
|
|
226
279
|
pageSize = 10;
|
|
@@ -235,11 +288,15 @@ class FolderFilesComponent {
|
|
|
235
288
|
pageSizeOptions = [
|
|
236
289
|
{ label: '5/pág', value: 5 },
|
|
237
290
|
{ label: '10/pág', value: 10 },
|
|
238
|
-
{ label: '20/pág', value: 20 }
|
|
291
|
+
{ label: '20/pág', value: 20 },
|
|
239
292
|
];
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
293
|
+
current_path = '';
|
|
294
|
+
current_label = '';
|
|
295
|
+
displayView = false;
|
|
296
|
+
constructor() {
|
|
297
|
+
this.searchSubject
|
|
298
|
+
.pipe(debounceTime(400), distinctUntilChanged(), takeUntil(this.destroy$))
|
|
299
|
+
.subscribe(() => {
|
|
243
300
|
this.page = 1;
|
|
244
301
|
if (this.usesApi) {
|
|
245
302
|
this.loadFiles();
|
|
@@ -259,6 +316,9 @@ class FolderFilesComponent {
|
|
|
259
316
|
this.destroy$.complete();
|
|
260
317
|
}
|
|
261
318
|
ngOnChanges(changes) {
|
|
319
|
+
this.current_path = '';
|
|
320
|
+
this.current_label = '';
|
|
321
|
+
this.displayView = false;
|
|
262
322
|
if (changes['carpeta'] && this.carpeta) {
|
|
263
323
|
this.init();
|
|
264
324
|
}
|
|
@@ -287,23 +347,33 @@ class FolderFilesComponent {
|
|
|
287
347
|
if (this.carpeta?.reglas && typeof this.carpeta.reglas === 'string') {
|
|
288
348
|
this.carpeta.reglas = JSON.parse(this.carpeta.reglas);
|
|
289
349
|
}
|
|
290
|
-
if (!this.carpeta?.reglas?.permisos?.subestados &&
|
|
291
|
-
this.carpeta
|
|
292
|
-
this.carpeta.reglas.permisos.
|
|
350
|
+
if (!this.carpeta?.reglas?.permisos?.subestados &&
|
|
351
|
+
this.carpeta?.reglas?.permisos) {
|
|
352
|
+
this.carpeta.reglas.permisos.cargarFront =
|
|
353
|
+
this.carpeta.reglas.permisos.cargar;
|
|
354
|
+
this.carpeta.reglas.permisos.borrarFront =
|
|
355
|
+
this.carpeta.reglas.permisos.borrar;
|
|
293
356
|
}
|
|
294
|
-
else if (this.carpeta?.reglas?.permisos?.subestados &&
|
|
357
|
+
else if (this.carpeta?.reglas?.permisos?.subestados &&
|
|
358
|
+
this.subestado?.trim()) {
|
|
295
359
|
const sub = this.subestado.toLowerCase().trim();
|
|
296
360
|
this.carpeta.reglas.permisos.cargarFront = Array.isArray(this.carpeta.reglas.permisos.subestados.cargar)
|
|
297
|
-
? this.carpeta.reglas.permisos.subestados.cargar
|
|
361
|
+
? this.carpeta.reglas.permisos.subestados.cargar
|
|
362
|
+
.map((c) => c.toLowerCase().trim())
|
|
363
|
+
.includes(sub)
|
|
298
364
|
: this.carpeta.reglas.permisos.cargar;
|
|
299
365
|
this.carpeta.reglas.permisos.borrarFront = Array.isArray(this.carpeta.reglas.permisos.subestados.borrar)
|
|
300
|
-
? this.carpeta.reglas.permisos.subestados.borrar
|
|
366
|
+
? this.carpeta.reglas.permisos.subestados.borrar
|
|
367
|
+
.map((b) => b.toLowerCase().trim())
|
|
368
|
+
.includes(sub)
|
|
301
369
|
: this.carpeta.reglas.permisos.borrar;
|
|
302
370
|
}
|
|
303
371
|
}
|
|
304
372
|
loadFiles() {
|
|
305
373
|
this.loading = true;
|
|
306
|
-
this.documentsService
|
|
374
|
+
this.documentsService
|
|
375
|
+
.getFilesByFolder(this.idKatios, this.carpeta.NMCo, this.requestData, this.page, this.pageSize, this.searchQuery)
|
|
376
|
+
.subscribe({
|
|
307
377
|
next: (response) => {
|
|
308
378
|
const res = response?.data ?? response;
|
|
309
379
|
this.totalRecords = res.total ?? 0;
|
|
@@ -317,7 +387,7 @@ class FolderFilesComponent {
|
|
|
317
387
|
error: (error) => {
|
|
318
388
|
console.error('Error loading files by folder:', error);
|
|
319
389
|
this.loading = false;
|
|
320
|
-
}
|
|
390
|
+
},
|
|
321
391
|
});
|
|
322
392
|
}
|
|
323
393
|
onPageChange(event) {
|
|
@@ -348,13 +418,17 @@ class FolderFilesComponent {
|
|
|
348
418
|
this.onCargarArchivo.emit(this.carpeta);
|
|
349
419
|
}
|
|
350
420
|
openVisorDoc(item) {
|
|
351
|
-
this.
|
|
421
|
+
this.viewDocument.emit(item);
|
|
422
|
+
}
|
|
423
|
+
openCurrentInNewWindow(path) {
|
|
424
|
+
window.open(path || this.current_path, '_blank').focus();
|
|
352
425
|
}
|
|
353
|
-
|
|
354
|
-
this.
|
|
426
|
+
canPreview(label, path) {
|
|
427
|
+
return (canPreviewFile(label || this.current_label) ||
|
|
428
|
+
canPreviewFile(path || this.current_path));
|
|
355
429
|
}
|
|
356
|
-
|
|
357
|
-
return
|
|
430
|
+
previewFallbackIcon(label, path) {
|
|
431
|
+
return getFileTypeIcon(label || this.current_label || path || this.current_path);
|
|
358
432
|
}
|
|
359
433
|
goBack() {
|
|
360
434
|
this.onBack.emit();
|
|
@@ -363,13 +437,13 @@ class FolderFilesComponent {
|
|
|
363
437
|
if (event.checked)
|
|
364
438
|
this.docsEliminables.push(document);
|
|
365
439
|
else
|
|
366
|
-
this.docsEliminables = this.docsEliminables.filter(doc => doc !== document);
|
|
440
|
+
this.docsEliminables = this.docsEliminables.filter((doc) => doc !== document);
|
|
367
441
|
}
|
|
368
442
|
emitEliminarMasivo() {
|
|
369
443
|
this.onEliminarMasivo.emit(this.docsEliminables);
|
|
370
444
|
}
|
|
371
445
|
toggleSelectAll() {
|
|
372
|
-
this.items.forEach(item => (item.delete = this.allSelected));
|
|
446
|
+
this.items.forEach((item) => (item.delete = this.allSelected));
|
|
373
447
|
this.docsEliminables = this.allSelected ? [...this.items] : [];
|
|
374
448
|
}
|
|
375
449
|
// refresh(): void {
|
|
@@ -382,17 +456,27 @@ class FolderFilesComponent {
|
|
|
382
456
|
this.page = 1;
|
|
383
457
|
this.loadFiles();
|
|
384
458
|
}
|
|
385
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FolderFilesComponent, deps: [
|
|
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" }] });
|
|
459
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FolderFilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
460
|
+
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", viewDocument: "viewDocument" }, 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", 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: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8.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 }] });
|
|
387
461
|
}
|
|
388
462
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FolderFilesComponent, decorators: [{
|
|
389
463
|
type: Component,
|
|
390
464
|
args: [{ selector: 'lib-folder-files', imports: [
|
|
391
|
-
CommonModule,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
465
|
+
CommonModule,
|
|
466
|
+
FormsModule,
|
|
467
|
+
ButtonModule,
|
|
468
|
+
CheckboxModule,
|
|
469
|
+
InputTextModule,
|
|
470
|
+
InputIcon,
|
|
471
|
+
IconField,
|
|
472
|
+
PaginatorModule,
|
|
473
|
+
SafePipe,
|
|
474
|
+
UploadDialogComponent,
|
|
475
|
+
SelectModule,
|
|
476
|
+
FlexibleDatePipe,
|
|
477
|
+
DialogModule,
|
|
478
|
+
], 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", 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"] }]
|
|
479
|
+
}], ctorParameters: () => [], propDecorators: { carpeta: [{
|
|
396
480
|
type: Input
|
|
397
481
|
}], isMobile: [{
|
|
398
482
|
type: Input
|
|
@@ -408,37 +492,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
408
492
|
type: Input
|
|
409
493
|
}], usesApi: [{
|
|
410
494
|
type: Input
|
|
495
|
+
}], allowedUploadTypes: [{
|
|
496
|
+
type: Input
|
|
411
497
|
}], onFileChange: [{
|
|
412
498
|
type: Output
|
|
413
499
|
}], onCargarArchivo: [{
|
|
414
500
|
type: Output
|
|
415
501
|
}], onEliminarMasivo: [{
|
|
416
502
|
type: Output
|
|
417
|
-
}], onOpenVisorDoc: [{
|
|
418
|
-
type: Output
|
|
419
|
-
}], onOpenNewWindow: [{
|
|
420
|
-
type: Output
|
|
421
503
|
}], onBack: [{
|
|
422
504
|
type: Output
|
|
505
|
+
}], viewDocument: [{
|
|
506
|
+
type: Output
|
|
423
507
|
}] } });
|
|
424
508
|
|
|
425
509
|
class SfDocumentsComponent {
|
|
426
510
|
sanitizer;
|
|
427
|
-
dialog;
|
|
428
511
|
snackBar;
|
|
429
512
|
appRef;
|
|
430
513
|
confirmationService;
|
|
431
514
|
documentService;
|
|
432
515
|
documentsService = inject(DOCUMENT_SERVICE);
|
|
433
|
-
accion =
|
|
434
|
-
entidad =
|
|
435
|
-
ndoc =
|
|
436
|
-
tdoc =
|
|
437
|
-
tipo =
|
|
516
|
+
accion = '';
|
|
517
|
+
entidad = '';
|
|
518
|
+
ndoc = '';
|
|
519
|
+
tdoc = '';
|
|
520
|
+
tipo = '';
|
|
438
521
|
//Información necesaria para cargar documentos de productos
|
|
439
|
-
Kasociada =
|
|
440
|
-
Producto =
|
|
441
|
-
Solicitud =
|
|
522
|
+
Kasociada = '';
|
|
523
|
+
Producto = '';
|
|
524
|
+
Solicitud = '';
|
|
442
525
|
oSession;
|
|
443
526
|
perfilDocumentos;
|
|
444
527
|
subestado = '';
|
|
@@ -451,24 +534,22 @@ class SfDocumentsComponent {
|
|
|
451
534
|
nmco = [];
|
|
452
535
|
useBreadcrumb = false;
|
|
453
536
|
usesApi = true;
|
|
537
|
+
/** Extensiones permitidas para subir (ej. ['.pdf', '.xlsx']). Si no se define, usa el default de la librería (pdf, xls, xlsx). */
|
|
538
|
+
allowedUploadTypes;
|
|
454
539
|
onNavigationChange = new EventEmitter();
|
|
455
|
-
server =
|
|
456
|
-
valorFiltro =
|
|
540
|
+
server = '';
|
|
541
|
+
valorFiltro = '';
|
|
457
542
|
tab = 1;
|
|
458
543
|
enProceso = false;
|
|
459
544
|
carpetaSeleccionada;
|
|
460
545
|
files;
|
|
461
546
|
filesFilter;
|
|
462
547
|
imagePathInput;
|
|
463
|
-
modalReference;
|
|
464
|
-
modalReference2;
|
|
465
548
|
documentoSeleccionado;
|
|
466
549
|
totalDocsEliminadosApi = { existoso: 0, fallido: 0 };
|
|
467
550
|
file;
|
|
468
551
|
urlDoc;
|
|
469
552
|
pdfUrl;
|
|
470
|
-
current_path = "";
|
|
471
|
-
current_label = "";
|
|
472
553
|
scanFileList = new Array();
|
|
473
554
|
displayPDF = false;
|
|
474
555
|
panel;
|
|
@@ -484,9 +565,11 @@ class SfDocumentsComponent {
|
|
|
484
565
|
dynamicValues = {};
|
|
485
566
|
selectedDocType = null;
|
|
486
567
|
selectedRange = null;
|
|
487
|
-
|
|
568
|
+
current_path = '';
|
|
569
|
+
current_label = '';
|
|
570
|
+
displayView = false;
|
|
571
|
+
constructor(sanitizer, snackBar, appRef, confirmationService, documentService) {
|
|
488
572
|
this.sanitizer = sanitizer;
|
|
489
|
-
this.dialog = dialog;
|
|
490
573
|
this.snackBar = snackBar;
|
|
491
574
|
this.appRef = appRef;
|
|
492
575
|
this.confirmationService = confirmationService;
|
|
@@ -505,16 +588,12 @@ class SfDocumentsComponent {
|
|
|
505
588
|
this.files = [];
|
|
506
589
|
this.filesFilter = [];
|
|
507
590
|
this.imagePathInput = null;
|
|
508
|
-
this.modalReference = undefined;
|
|
509
|
-
this.modalReference2 = undefined;
|
|
510
591
|
this.carpetaSeleccionada = null;
|
|
511
592
|
this.documentoSeleccionado = null;
|
|
512
593
|
this.totalDocsEliminadosApi = { existoso: 0, fallido: 0 };
|
|
513
594
|
this.file = null;
|
|
514
595
|
this.urlDoc = null;
|
|
515
596
|
this.pdfUrl = null;
|
|
516
|
-
this.current_path = "";
|
|
517
|
-
this.current_label = "";
|
|
518
597
|
this.scanFileList = new Array();
|
|
519
598
|
this.displayPDF = false;
|
|
520
599
|
this.displayGenerate = false;
|
|
@@ -526,7 +605,9 @@ class SfDocumentsComponent {
|
|
|
526
605
|
this.dynamicValues = {};
|
|
527
606
|
this.selectedDocType = null;
|
|
528
607
|
this.selectedRange = null;
|
|
529
|
-
if (this.oSession != null &&
|
|
608
|
+
if (this.oSession != null &&
|
|
609
|
+
this.oSession.UsuarioSistema.TDOC !== undefined &&
|
|
610
|
+
this.oSession.UsuarioSistema.NDOC !== undefined) {
|
|
530
611
|
this.idKatios = this.oSession.UsuarioSistema.IDKATIOS.trim();
|
|
531
612
|
this.perfilDocumentos = this.oSession.UsuarioSistema.PERDOCUMENTOS.trim();
|
|
532
613
|
}
|
|
@@ -546,14 +627,18 @@ class SfDocumentsComponent {
|
|
|
546
627
|
ndoc: this.ndoc,
|
|
547
628
|
request: this.Solicitud,
|
|
548
629
|
documentProfile: this.perfilDocumentos,
|
|
549
|
-
product: this.Producto
|
|
630
|
+
product: this.Producto,
|
|
550
631
|
};
|
|
551
|
-
this.documentsService
|
|
632
|
+
this.documentsService
|
|
633
|
+
.getFolders(this.idKatios, data)
|
|
634
|
+
.pipe(tap((response) => {
|
|
552
635
|
let res = response.data;
|
|
553
636
|
if (response.data.RESPUESTA)
|
|
554
637
|
res = response.data.RESPUESTA;
|
|
555
638
|
this.okCargoArbol(res);
|
|
556
|
-
}), switchMap(() => this.Solicitud
|
|
639
|
+
}), switchMap(() => this.Solicitud
|
|
640
|
+
? this.documentsService.getDocumentsToGenerate(this.idKatios, this.Solicitud)
|
|
641
|
+
: of(null)), tap((resp) => {
|
|
557
642
|
const list = resp?.data ?? []; // según tu JSON real
|
|
558
643
|
this.documentsToGenerate = list;
|
|
559
644
|
this.documentsToGenerateMap = {};
|
|
@@ -561,14 +646,15 @@ class SfDocumentsComponent {
|
|
|
561
646
|
// dropdown: usa idDoc pero mantén objeto completo en map
|
|
562
647
|
this.documentTypes = list.map((d) => ({
|
|
563
648
|
label: d.description,
|
|
564
|
-
code: d.idDoc
|
|
649
|
+
code: d.idDoc,
|
|
565
650
|
}));
|
|
566
651
|
}), finalize(() => {
|
|
567
652
|
this.documentService.loadingData = false;
|
|
568
|
-
}))
|
|
653
|
+
}))
|
|
654
|
+
.subscribe({
|
|
569
655
|
error: (error) => {
|
|
570
656
|
this.errorCargarArbol(error);
|
|
571
|
-
}
|
|
657
|
+
},
|
|
572
658
|
});
|
|
573
659
|
this.tab = 1;
|
|
574
660
|
this.documentoSeleccionado = null;
|
|
@@ -584,14 +670,14 @@ class SfDocumentsComponent {
|
|
|
584
670
|
var objeto;
|
|
585
671
|
objeto = node;
|
|
586
672
|
if (node.children && node.children?.length > 0) {
|
|
587
|
-
node.children.forEach(childNode => {
|
|
673
|
+
node.children.forEach((childNode) => {
|
|
588
674
|
this.expandRecursive(childNode, isExpand);
|
|
589
675
|
});
|
|
590
676
|
}
|
|
591
677
|
else if (objeto.Path !== undefined) {
|
|
592
678
|
var path = 'Imagenes/' + objeto.Path + objeto.label;
|
|
593
679
|
var re = /[\\]/gi;
|
|
594
|
-
path = path.replace(re,
|
|
680
|
+
path = path.replace(re, '/');
|
|
595
681
|
objeto.Path = this.server + path;
|
|
596
682
|
//this.sanitizer.bypassSecurityTrustUrl(this.server + path)
|
|
597
683
|
}
|
|
@@ -615,7 +701,7 @@ class SfDocumentsComponent {
|
|
|
615
701
|
this.documentService.loadingData = false;
|
|
616
702
|
};
|
|
617
703
|
errorCargarArbol = (iError) => {
|
|
618
|
-
this.message(
|
|
704
|
+
this.message('error', 'Error al traer la información', iError.message);
|
|
619
705
|
this.documentService.loadingData = false;
|
|
620
706
|
};
|
|
621
707
|
// onClickedCheckDelete($event: any, document: any) {
|
|
@@ -624,19 +710,23 @@ class SfDocumentsComponent {
|
|
|
624
710
|
// }
|
|
625
711
|
funcOkDelDocumentMasivo = (docsEliminables) => {
|
|
626
712
|
this.totalDocsEliminadosApi.existoso += 1;
|
|
627
|
-
if (this.totalDocsEliminadosApi.existoso +
|
|
713
|
+
if (this.totalDocsEliminadosApi.existoso +
|
|
714
|
+
this.totalDocsEliminadosApi.fallido ===
|
|
715
|
+
docsEliminables.length) {
|
|
628
716
|
this.cargarParametros(this.tipo);
|
|
629
717
|
if (this.totalDocsEliminadosApi.fallido > 0)
|
|
630
|
-
this.message(
|
|
718
|
+
this.message('warn', '', 'Algunos documentos no pudieron ser eliminados');
|
|
631
719
|
else
|
|
632
|
-
this.message(
|
|
720
|
+
this.message('success', '', 'Documentos eliminados satisfactoriamente');
|
|
633
721
|
}
|
|
634
722
|
};
|
|
635
723
|
funcErrDelDocumentMasivo = (docsEliminables) => {
|
|
636
724
|
this.totalDocsEliminadosApi.fallido += 1;
|
|
637
|
-
if (this.totalDocsEliminadosApi.existoso +
|
|
725
|
+
if (this.totalDocsEliminadosApi.existoso +
|
|
726
|
+
this.totalDocsEliminadosApi.fallido ===
|
|
727
|
+
docsEliminables.length) {
|
|
638
728
|
this.cargarParametros(this.tipo);
|
|
639
|
-
this.message(
|
|
729
|
+
this.message('warn', '', 'Algunos documentos no pudieron ser eliminados');
|
|
640
730
|
}
|
|
641
731
|
};
|
|
642
732
|
eliminarMasivo(docsEliminables) {
|
|
@@ -647,8 +737,8 @@ class SfDocumentsComponent {
|
|
|
647
737
|
accept: () => {
|
|
648
738
|
this.documentService.loading = true;
|
|
649
739
|
this.totalDocsEliminadosApi = { existoso: 0, fallido: 0 };
|
|
650
|
-
docsEliminables.forEach(doc => {
|
|
651
|
-
let data = {
|
|
740
|
+
docsEliminables.forEach((doc) => {
|
|
741
|
+
let data = { code: doc.codigo, status: 'DES' };
|
|
652
742
|
this.documentsService.updateStatus(this.idKatios, data).subscribe({
|
|
653
743
|
next: (response) => {
|
|
654
744
|
this.funcOkDelDocumentMasivo(docsEliminables);
|
|
@@ -656,10 +746,10 @@ class SfDocumentsComponent {
|
|
|
656
746
|
error: (error) => {
|
|
657
747
|
this.documentService.loading = false;
|
|
658
748
|
this.funcErrDelDocumentMasivo(docsEliminables);
|
|
659
|
-
}
|
|
749
|
+
},
|
|
660
750
|
});
|
|
661
751
|
});
|
|
662
|
-
}
|
|
752
|
+
},
|
|
663
753
|
});
|
|
664
754
|
}
|
|
665
755
|
filtrarTipoDocumento(iArbol) {
|
|
@@ -679,25 +769,6 @@ class SfDocumentsComponent {
|
|
|
679
769
|
this.convertirArrayChildren(childNode);
|
|
680
770
|
});
|
|
681
771
|
}
|
|
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
772
|
// takePhotoClick() {
|
|
702
773
|
// this.documentsService.openCamera(this.ok_openCamera, this.error_openCamera);
|
|
703
774
|
// }
|
|
@@ -730,11 +801,11 @@ class SfDocumentsComponent {
|
|
|
730
801
|
// }
|
|
731
802
|
loadFileToList(file) {
|
|
732
803
|
setTimeout(() => {
|
|
733
|
-
file[
|
|
804
|
+
file['name'] = 'scan' + Date.now() + this.scanFileList.length + '.jpg';
|
|
734
805
|
this.scanFileList.push(file);
|
|
735
806
|
this.scanFileList = this.scanFileList.slice();
|
|
736
807
|
this.documentService.loading = false;
|
|
737
|
-
this.message(
|
|
808
|
+
this.message('success', '', 'Archivo cargado exitosamente');
|
|
738
809
|
this.appRef.tick();
|
|
739
810
|
}, 200);
|
|
740
811
|
}
|
|
@@ -747,72 +818,66 @@ class SfDocumentsComponent {
|
|
|
747
818
|
// }
|
|
748
819
|
noZonePatch(cb) {
|
|
749
820
|
const orig = FileReader;
|
|
750
|
-
const unpatched = window.FileReader
|
|
821
|
+
const unpatched = window.FileReader
|
|
822
|
+
.__zone_symbol__OriginalDelegate;
|
|
751
823
|
window.FileReader = unpatched;
|
|
752
824
|
cb();
|
|
753
825
|
window.FileReader = orig;
|
|
754
826
|
}
|
|
755
|
-
makeFileIntoBlob(_imagePath) {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}
|
|
827
|
+
// makeFileIntoBlob(_imagePath: any): Promise<Blob> {
|
|
828
|
+
// this.documentService.loading = true;
|
|
829
|
+
// // INSTALL PLUGIN - cordova plugin add cordova-plugin-file
|
|
830
|
+
// return new Promise((resolve, reject) => {
|
|
831
|
+
// try {
|
|
832
|
+
// window.resolveLocalFileSystemURL(_imagePath, (fileEntry: any) => {
|
|
833
|
+
// fileEntry.file((resFile: any) => {
|
|
834
|
+
// this.noZonePatch(() => {//! Alert 1: Comentarear esta linea y una de de abajo para ambiente de prueba
|
|
835
|
+
// var reader = new FileReader();
|
|
836
|
+
// reader.onloadend = (evt: any) => {
|
|
837
|
+
// var imgBlob: any = new Blob([evt.target.result], { type: 'image/jpeg' });
|
|
838
|
+
// imgBlob.name = 'scan.jpg';
|
|
839
|
+
// resolve(imgBlob);
|
|
840
|
+
// };
|
|
841
|
+
// reader.onerror = (e) => {
|
|
842
|
+
// console.log('Failed file read: ' + e.toString());
|
|
843
|
+
// reject(e);
|
|
844
|
+
// };
|
|
845
|
+
// reader.readAsArrayBuffer(resFile);
|
|
846
|
+
// });//!Comentarear esta linea y una de de arriba para ambiente de prueba
|
|
847
|
+
// });
|
|
848
|
+
// }, (error: any) => {
|
|
849
|
+
// console.error('Error resolving file system URL:', error);
|
|
850
|
+
// reject(error);
|
|
851
|
+
// });
|
|
852
|
+
// } catch (ex) {
|
|
853
|
+
// console.error('Error in makeFileIntoBlob:', ex);
|
|
854
|
+
// reject(ex);
|
|
855
|
+
// }
|
|
856
|
+
// });
|
|
857
|
+
// }
|
|
787
858
|
subirImagen(data, fileList) {
|
|
788
859
|
this.documentService.loading = true;
|
|
789
860
|
const formData = new FormData();
|
|
790
861
|
var dataDocs;
|
|
791
862
|
var sIdKatios = this.idKatios;
|
|
792
|
-
dataDocs = {
|
|
863
|
+
dataDocs = { data: data };
|
|
793
864
|
formData.append('data', JSON.stringify(dataDocs));
|
|
794
|
-
formData.append('merge',
|
|
865
|
+
formData.append('merge', 'true');
|
|
795
866
|
for (let _i = 0; _i < fileList.length; _i++) {
|
|
796
867
|
formData.append('files', fileList[_i], fileList[_i].name);
|
|
797
868
|
}
|
|
798
869
|
this.documentsService.uploadFiles(sIdKatios, formData).subscribe({
|
|
799
870
|
next: (response) => {
|
|
800
871
|
this.scanFileList = new Array();
|
|
801
|
-
|
|
802
|
-
this.modalReference2.close();
|
|
803
|
-
}
|
|
804
|
-
if (this.modalReference) {
|
|
805
|
-
this.modalReference.close();
|
|
806
|
-
}
|
|
807
|
-
this.message("success", "Felicidades", "Se almacenó el documento correctamente");
|
|
872
|
+
this.message('success', 'Felicidades', 'Se almacenó el documento correctamente');
|
|
808
873
|
this.cargarParametros(this.tipo);
|
|
809
874
|
this.documentService.loading = false;
|
|
810
875
|
this.appRef.tick();
|
|
811
876
|
},
|
|
812
877
|
error: (err) => {
|
|
813
878
|
this.documentService.loading = false;
|
|
814
|
-
this.message(
|
|
815
|
-
console.error(
|
|
879
|
+
this.message('error', 'Se presentaron inconvenientes almacenando el documento', err.message);
|
|
880
|
+
console.error('Error : ' + err);
|
|
816
881
|
},
|
|
817
882
|
});
|
|
818
883
|
}
|
|
@@ -820,72 +885,57 @@ class SfDocumentsComponent {
|
|
|
820
885
|
this.documentService.loading = true;
|
|
821
886
|
var sPath1;
|
|
822
887
|
var dataClientes;
|
|
823
|
-
let sPaths =
|
|
824
|
-
if (this.documentoSeleccionado.Tipo.trim().toUpperCase() ==
|
|
825
|
-
sPath1 =
|
|
826
|
-
|
|
888
|
+
let sPaths = '';
|
|
889
|
+
if (this.documentoSeleccionado.Tipo.trim().toUpperCase() == 'PERSONA') {
|
|
890
|
+
sPath1 =
|
|
891
|
+
this.documentoSeleccionado.Tipo.trim() +
|
|
892
|
+
'\\' +
|
|
893
|
+
this.tdoc.trim() +
|
|
894
|
+
'\\' +
|
|
895
|
+
this.ndoc.trim() +
|
|
896
|
+
'\\Cliente\\' +
|
|
897
|
+
this.documentoSeleccionado.NMCo.trim();
|
|
827
898
|
}
|
|
828
899
|
else {
|
|
829
900
|
//Kasociada
|
|
830
901
|
//producto
|
|
831
902
|
//Falta numero de solicitud
|
|
832
|
-
sPath1 =
|
|
833
|
-
|
|
903
|
+
sPath1 =
|
|
904
|
+
this.documentoSeleccionado.Tipo.trim() +
|
|
905
|
+
'\\' +
|
|
906
|
+
this.Kasociada +
|
|
907
|
+
'\\' +
|
|
908
|
+
this.Producto +
|
|
909
|
+
'\\' +
|
|
910
|
+
this.Solicitud +
|
|
911
|
+
'\\' +
|
|
912
|
+
this.documentoSeleccionado.NMCo;
|
|
834
913
|
}
|
|
835
914
|
dataClientes = {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
915
|
+
Tipo: this.documentoSeleccionado.Tipo,
|
|
916
|
+
id: '1',
|
|
917
|
+
documento: this.documentoSeleccionado.NMCo,
|
|
918
|
+
tdoc: this.tdoc.trim(),
|
|
919
|
+
ndoc: this.ndoc.trim(),
|
|
920
|
+
IdProducto: this.Solicitud,
|
|
921
|
+
TipoProducto: this.Producto,
|
|
922
|
+
Kasociada: this.Kasociada,
|
|
923
|
+
archivoUpload: fileList[0],
|
|
924
|
+
nombre: this.tdoc.trim() + '-' + this.ndoc.trim(),
|
|
925
|
+
fileCargado: fileList[0],
|
|
926
|
+
pathArchivo: sPath1,
|
|
927
|
+
TipoArchivo: this.documentoSeleccionado.TipoArchivo,
|
|
849
928
|
};
|
|
850
|
-
sPaths = sPaths + sPath1 +
|
|
929
|
+
sPaths = sPaths + sPath1 + ',';
|
|
851
930
|
this.subirImagen(dataClientes, fileList);
|
|
852
931
|
}
|
|
853
932
|
cargarArchivo(iNodo) {
|
|
854
933
|
this.scanFileList = new Array();
|
|
855
934
|
this.documentoSeleccionado = iNodo;
|
|
856
935
|
}
|
|
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
936
|
async seleccionoDocs(iNodo) {
|
|
887
937
|
var path = iNodo.Path + iNodo.label;
|
|
888
|
-
this.pdfUrl =
|
|
938
|
+
this.pdfUrl = '//imagenes//' + iNodo.idKatios + '//' + path;
|
|
889
939
|
this.pdfUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.pdfUrl);
|
|
890
940
|
this.gotoBottom();
|
|
891
941
|
}
|
|
@@ -894,7 +944,7 @@ class SfDocumentsComponent {
|
|
|
894
944
|
severity: severity,
|
|
895
945
|
summary: summary,
|
|
896
946
|
detail: message,
|
|
897
|
-
life: 4000
|
|
947
|
+
life: 4000,
|
|
898
948
|
});
|
|
899
949
|
}
|
|
900
950
|
gotoBottom() {
|
|
@@ -908,7 +958,7 @@ class SfDocumentsComponent {
|
|
|
908
958
|
ndoc: this.ndoc,
|
|
909
959
|
request: this.Solicitud,
|
|
910
960
|
documentProfile: this.perfilDocumentos,
|
|
911
|
-
product: this.Producto
|
|
961
|
+
product: this.Producto,
|
|
912
962
|
};
|
|
913
963
|
}
|
|
914
964
|
VerDetalleTab(items) {
|
|
@@ -926,8 +976,7 @@ class SfDocumentsComponent {
|
|
|
926
976
|
return;
|
|
927
977
|
const state = { tab: this.tab };
|
|
928
978
|
if (this.tab === 2 && this.carpetaSeleccionada) {
|
|
929
|
-
state.folderLabel = (this.carpetaSeleccionada.label || '')
|
|
930
|
-
.replace('#toolbar=0&navpanes=0&statusbar=0', '');
|
|
979
|
+
state.folderLabel = (this.carpetaSeleccionada.label || '').replace('#toolbar=0&navpanes=0&statusbar=0', '');
|
|
931
980
|
}
|
|
932
981
|
this.onNavigationChange.emit(state);
|
|
933
982
|
}
|
|
@@ -936,23 +985,24 @@ class SfDocumentsComponent {
|
|
|
936
985
|
this.nextTabPapa.emit(iValor);
|
|
937
986
|
}
|
|
938
987
|
else {
|
|
939
|
-
var respuesta =
|
|
988
|
+
var respuesta = '';
|
|
940
989
|
if (this.files)
|
|
941
990
|
respuesta = this.valorDocumentosPendientes(this.files[0]);
|
|
942
|
-
if (respuesta ==
|
|
991
|
+
if (respuesta == '') {
|
|
943
992
|
this.nextTabPapa.emit(iValor);
|
|
944
993
|
}
|
|
945
994
|
else {
|
|
946
|
-
this.message(
|
|
995
|
+
this.message('warn', 'Ups!', respuesta);
|
|
947
996
|
}
|
|
948
997
|
}
|
|
949
998
|
}
|
|
950
999
|
valorDocumentosPendientes(carpetas) {
|
|
951
|
-
var respuesta =
|
|
1000
|
+
var respuesta = '';
|
|
952
1001
|
if (carpetas.children) {
|
|
953
1002
|
carpetas.children.forEach((carpeta) => {
|
|
954
|
-
if (carpeta.Obligatorio == 1 &&
|
|
955
|
-
|
|
1003
|
+
if (carpeta.Obligatorio == 1 &&
|
|
1004
|
+
(!carpeta.children || carpeta.children.length == 0))
|
|
1005
|
+
respuesta = 'Falta ' + carpeta.label;
|
|
956
1006
|
});
|
|
957
1007
|
}
|
|
958
1008
|
return respuesta;
|
|
@@ -969,14 +1019,6 @@ class SfDocumentsComponent {
|
|
|
969
1019
|
this.filesFilter[i].children = node;
|
|
970
1020
|
}
|
|
971
1021
|
}
|
|
972
|
-
ngOnDestroy() {
|
|
973
|
-
if (this.modalReference) {
|
|
974
|
-
this.modalReference.close();
|
|
975
|
-
}
|
|
976
|
-
if (this.modalReference2) {
|
|
977
|
-
this.modalReference2.close();
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
1022
|
openGenerateDialog() {
|
|
981
1023
|
this.selectedDocType = null;
|
|
982
1024
|
this.selectedRange = null;
|
|
@@ -1000,15 +1042,15 @@ class SfDocumentsComponent {
|
|
|
1000
1042
|
const key = p.name;
|
|
1001
1043
|
const raw = this.dynamicValues?.[key];
|
|
1002
1044
|
paramsToSend[p.name] =
|
|
1003
|
-
(p.type || '').toLowerCase() === 'date'
|
|
1004
|
-
? this.toYYYYMMDD(raw)
|
|
1005
|
-
: raw;
|
|
1045
|
+
(p.type || '').toLowerCase() === 'date' ? this.toYYYYMMDD(raw) : raw;
|
|
1006
1046
|
}
|
|
1007
1047
|
this.enProceso = true;
|
|
1008
1048
|
const payload = {
|
|
1009
|
-
params: paramsToSend
|
|
1049
|
+
params: paramsToSend,
|
|
1010
1050
|
};
|
|
1011
|
-
this.documentsService
|
|
1051
|
+
this.documentsService
|
|
1052
|
+
.generateDocument(this.idKatios, this.selectedDocType, this.Solicitud, payload)
|
|
1053
|
+
.subscribe({
|
|
1012
1054
|
next: () => {
|
|
1013
1055
|
this.displayGenerate = false;
|
|
1014
1056
|
this.message('success', '', 'Documento en generación');
|
|
@@ -1018,7 +1060,7 @@ class SfDocumentsComponent {
|
|
|
1018
1060
|
error: (err) => {
|
|
1019
1061
|
this.message('error', 'No se pudo generar el documento', err?.message || err);
|
|
1020
1062
|
this.enProceso = false;
|
|
1021
|
-
}
|
|
1063
|
+
},
|
|
1022
1064
|
});
|
|
1023
1065
|
}
|
|
1024
1066
|
toYYYYMMDD(value) {
|
|
@@ -1031,7 +1073,9 @@ class SfDocumentsComponent {
|
|
|
1031
1073
|
return d.toISOString().slice(0, 10);
|
|
1032
1074
|
}
|
|
1033
1075
|
onDocTypeChange() {
|
|
1034
|
-
const doc = this.selectedDocType
|
|
1076
|
+
const doc = this.selectedDocType
|
|
1077
|
+
? this.documentsToGenerateMap[this.selectedDocType]
|
|
1078
|
+
: null;
|
|
1035
1079
|
this.dynamicParams = doc?.params ?? [];
|
|
1036
1080
|
this.dynamicValues = {}; // reset valores
|
|
1037
1081
|
// valores default opcionales
|
|
@@ -1040,18 +1084,51 @@ class SfDocumentsComponent {
|
|
|
1040
1084
|
this.dynamicValues[key] = null;
|
|
1041
1085
|
}
|
|
1042
1086
|
}
|
|
1043
|
-
|
|
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\">×</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"] }] });
|
|
1087
|
+
openVisorDoc(item) {
|
|
1088
|
+
if (this.carpetaSeleccionada.TipoArchivo == '1' && this.isMobile) {
|
|
1089
|
+
//is mobile
|
|
1090
|
+
cordova.InAppBrowser.open(item.Path, '_system', 'location=yes');
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
this.current_path = item.Path;
|
|
1094
|
+
this.current_label = item.label;
|
|
1095
|
+
this.displayView = true;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
openCurrentInNewWindow(path) {
|
|
1099
|
+
window.open(path || this.current_path, '_blank').focus();
|
|
1100
|
+
}
|
|
1101
|
+
canPreview(label, path) {
|
|
1102
|
+
return (canPreviewFile(label || this.current_label) ||
|
|
1103
|
+
canPreviewFile(path || this.current_path));
|
|
1104
|
+
}
|
|
1105
|
+
previewFallbackIcon(label, path) {
|
|
1106
|
+
return getFileTypeIcon(label || this.current_label || path || this.current_path);
|
|
1107
|
+
}
|
|
1108
|
+
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 });
|
|
1109
|
+
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 (viewDocument)=\"openVisorDoc($event)\"\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\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 appendTo=\"body\"\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=\"carpetaSeleccionada.TipoArchivo == '2'\"\r\n [src]=\"current_path | safe\"\r\n style=\"width: 100%; min-height: 600px\"\r\n />\r\n <iframe\r\n *ngIf=\"carpetaSeleccionada.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\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: i7$1.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: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i8.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: "pipe", type: SafePipe, name: "safe" }, { 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", "viewDocument"] }, { 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
1110
|
}
|
|
1046
1111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SfDocumentsComponent, decorators: [{
|
|
1047
1112
|
type: Component,
|
|
1048
1113
|
args: [{ selector: 'app-sf-documents', imports: [
|
|
1049
|
-
ToastModule,
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
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\">×</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
|
-
|
|
1114
|
+
ToastModule,
|
|
1115
|
+
ButtonModule,
|
|
1116
|
+
ConfirmDialogModule,
|
|
1117
|
+
PanelModule,
|
|
1118
|
+
CheckboxModule,
|
|
1119
|
+
DialogModule,
|
|
1120
|
+
CommonModule,
|
|
1121
|
+
FormsModule,
|
|
1122
|
+
SafePipe,
|
|
1123
|
+
InputTextModule,
|
|
1124
|
+
InputIcon,
|
|
1125
|
+
IconField,
|
|
1126
|
+
FolderFilesComponent,
|
|
1127
|
+
DropdownModule,
|
|
1128
|
+
DatePickerModule,
|
|
1129
|
+
SkeletonModule,
|
|
1130
|
+
], 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 (viewDocument)=\"openVisorDoc($event)\"\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\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 appendTo=\"body\"\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=\"carpetaSeleccionada.TipoArchivo == '2'\"\r\n [src]=\"current_path | safe\"\r\n style=\"width: 100%; min-height: 600px\"\r\n />\r\n <iframe\r\n *ngIf=\"carpetaSeleccionada.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\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"] }]
|
|
1131
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: i2$1.MessageService }, { type: i0.ApplicationRef }, { type: i2$1.ConfirmationService }, { type: SfDocumentsService }], propDecorators: { accion: [{
|
|
1055
1132
|
type: Input
|
|
1056
1133
|
}], entidad: [{
|
|
1057
1134
|
type: Input
|
|
@@ -1091,6 +1168,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1091
1168
|
type: Input
|
|
1092
1169
|
}], usesApi: [{
|
|
1093
1170
|
type: Input
|
|
1171
|
+
}], allowedUploadTypes: [{
|
|
1172
|
+
type: Input
|
|
1094
1173
|
}], onNavigationChange: [{
|
|
1095
1174
|
type: Output
|
|
1096
1175
|
}], server: [{
|