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