cat-documents-ng 0.1.14 → 0.1.16
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/README.md +1 -1
- package/Shared/constant/SHARED.d.ts +6 -0
- package/fesm2022/cat-documents-ng.mjs +134 -172
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +4 -7
- package/lib/document/components/document-list/document-list.component.d.ts +18 -1
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +1 -9
- package/lib/document/document.module.d.ts +18 -19
- package/lib/document/models/document.model.d.ts +1 -0
- package/lib/document/services/document-http.service.d.ts +10 -1
- package/lib/document/state/document.query.d.ts +1 -7
- package/lib/document/state/document.state.d.ts +0 -1
- package/lib/document/state/document.store.d.ts +0 -2
- package/package.json +1 -1
- package/lib/document/components/linked-document/linked-document.component.d.ts +0 -38
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Component, Input, EventEmitter, Output, ViewEncapsulation, ViewChild, Directive, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
3
3
|
import * as i5 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { firstValueFrom, tap, catchError, throwError, BehaviorSubject, Subscription } from 'rxjs';
|
|
5
|
+
import { firstValueFrom, tap, EMPTY, catchError, throwError, BehaviorSubject, Subscription } from 'rxjs';
|
|
6
6
|
import { __decorate } from 'tslib';
|
|
7
7
|
import { EntityStore, StoreConfig, QueryEntity } from '@datorama/akita';
|
|
8
8
|
import * as i2 from '@angular/common/http';
|
|
@@ -22,6 +22,8 @@ import * as i11 from 'primeng/dialog';
|
|
|
22
22
|
import { DialogModule } from 'primeng/dialog';
|
|
23
23
|
import * as i12 from 'primeng/dropdown';
|
|
24
24
|
import { DropdownModule } from 'primeng/dropdown';
|
|
25
|
+
import * as i13 from 'primeng/inputtext';
|
|
26
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
25
27
|
import * as i7$1 from 'primeng/fileupload';
|
|
26
28
|
import { FileUploadModule } from 'primeng/fileupload';
|
|
27
29
|
import * as i8 from 'primeng/progressbar';
|
|
@@ -34,7 +36,6 @@ import { ListboxModule } from 'primeng/listbox';
|
|
|
34
36
|
import { TimelineModule } from 'primeng/timeline';
|
|
35
37
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
36
38
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
37
|
-
import { InputTextModule } from 'primeng/inputtext';
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* The `SHARED` class contains shared constants used across the application.
|
|
@@ -173,6 +174,12 @@ class SHARED {
|
|
|
173
174
|
* @type {string}
|
|
174
175
|
*/
|
|
175
176
|
static UPLOAD_ERROR_DETAILS = 'Required form data is missing. Please ensure the document and all required fields are provided.';
|
|
177
|
+
/**
|
|
178
|
+
* Represents the message prefix for a successful document name update.
|
|
179
|
+
* @static
|
|
180
|
+
* @type {string}
|
|
181
|
+
*/
|
|
182
|
+
static UPDATE_DOCUMENT_NAME = 'Document name updated for ID:';
|
|
176
183
|
}
|
|
177
184
|
/**
|
|
178
185
|
* `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
|
|
@@ -351,6 +358,67 @@ class ERRORS {
|
|
|
351
358
|
static ERROR_DOCUMENT_TYPES = "Error fetching document types:";
|
|
352
359
|
}
|
|
353
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Class that holds the URLs used throughout the application.
|
|
363
|
+
* These URLs are typically used for making API requests and accessing various resources.
|
|
364
|
+
* @class URLS
|
|
365
|
+
* @typedef {URLS}
|
|
366
|
+
*/
|
|
367
|
+
class URLS {
|
|
368
|
+
/**
|
|
369
|
+
* The URL to fetch the application configuration file.
|
|
370
|
+
* This JSON file typically contains settings and options for the application.
|
|
371
|
+
* @static
|
|
372
|
+
* @type {string}
|
|
373
|
+
*/
|
|
374
|
+
static CONFIGFILEURL = "assets/config/api.config.json";
|
|
375
|
+
/**
|
|
376
|
+
* The URL endpoint for document uploads.
|
|
377
|
+
* Used to send documents to the server for storage or processing.
|
|
378
|
+
* @static
|
|
379
|
+
* @type {string}
|
|
380
|
+
*/
|
|
381
|
+
static DOCUMENT_UPLOAD = "Documents";
|
|
382
|
+
/**
|
|
383
|
+
* The query parameter to pass a context ID in API requests.
|
|
384
|
+
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
385
|
+
* @static
|
|
386
|
+
* @type {string}
|
|
387
|
+
*/
|
|
388
|
+
static CONTEXT = "?contextId=";
|
|
389
|
+
/**
|
|
390
|
+
* The query parameter to pass a document ID in API requests.
|
|
391
|
+
* @static
|
|
392
|
+
* @type {string}
|
|
393
|
+
*/
|
|
394
|
+
static DOCUMENT_TYPES = "documentTypes";
|
|
395
|
+
/**
|
|
396
|
+
* The query parameter to pass a context ID in API requests.
|
|
397
|
+
* @static
|
|
398
|
+
* @type {string}
|
|
399
|
+
*/
|
|
400
|
+
static FOLDERS = "/folders?contextId=";
|
|
401
|
+
/**
|
|
402
|
+
* The query parameter to pass a document ID in API requests.
|
|
403
|
+
* @static
|
|
404
|
+
* @type {string}
|
|
405
|
+
*/
|
|
406
|
+
static ALERT_BY_DOCUMENT_ID = "alerts?documentId=";
|
|
407
|
+
/**
|
|
408
|
+
* The query parameter to pass a document ID in API requests.
|
|
409
|
+
* @static
|
|
410
|
+
* @type {string}
|
|
411
|
+
*/
|
|
412
|
+
static PARENT_DOCUMENT_TYPE_ID = "parentDocumentType?parentDocumentTypeId=";
|
|
413
|
+
/**
|
|
414
|
+
* The query parameter to pass a context ID in API requests.
|
|
415
|
+
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
416
|
+
* @static
|
|
417
|
+
* @type {string}
|
|
418
|
+
*/
|
|
419
|
+
static CONTEXT_ID = "&contextId=";
|
|
420
|
+
}
|
|
421
|
+
|
|
354
422
|
/**
|
|
355
423
|
* Creates the initial state for the `DocumentState` store.
|
|
356
424
|
* This function provides default values for all properties in the `DocumentState` interface,
|
|
@@ -368,8 +436,7 @@ function createInitialState() {
|
|
|
368
436
|
parentDocumentTypeId: null,
|
|
369
437
|
documentAlert: { _id: '' },
|
|
370
438
|
folders: [],
|
|
371
|
-
messages: []
|
|
372
|
-
documentList: []
|
|
439
|
+
messages: []
|
|
373
440
|
};
|
|
374
441
|
}
|
|
375
442
|
|
|
@@ -405,9 +472,6 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
405
472
|
setMessage(message) {
|
|
406
473
|
this.update({ messages: message });
|
|
407
474
|
}
|
|
408
|
-
setDocumentList(documents) {
|
|
409
|
-
this.update({ documents: documents });
|
|
410
|
-
}
|
|
411
475
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
412
476
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, providedIn: 'root' });
|
|
413
477
|
};
|
|
@@ -419,67 +483,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
419
483
|
args: [{ providedIn: 'root' }]
|
|
420
484
|
}], ctorParameters: () => [] });
|
|
421
485
|
|
|
422
|
-
/**
|
|
423
|
-
* Class that holds the URLs used throughout the application.
|
|
424
|
-
* These URLs are typically used for making API requests and accessing various resources.
|
|
425
|
-
* @class URLS
|
|
426
|
-
* @typedef {URLS}
|
|
427
|
-
*/
|
|
428
|
-
class URLS {
|
|
429
|
-
/**
|
|
430
|
-
* The URL to fetch the application configuration file.
|
|
431
|
-
* This JSON file typically contains settings and options for the application.
|
|
432
|
-
* @static
|
|
433
|
-
* @type {string}
|
|
434
|
-
*/
|
|
435
|
-
static CONFIGFILEURL = "assets/config/api.config.json";
|
|
436
|
-
/**
|
|
437
|
-
* The URL endpoint for document uploads.
|
|
438
|
-
* Used to send documents to the server for storage or processing.
|
|
439
|
-
* @static
|
|
440
|
-
* @type {string}
|
|
441
|
-
*/
|
|
442
|
-
static DOCUMENT_UPLOAD = "Documents";
|
|
443
|
-
/**
|
|
444
|
-
* The query parameter to pass a context ID in API requests.
|
|
445
|
-
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
446
|
-
* @static
|
|
447
|
-
* @type {string}
|
|
448
|
-
*/
|
|
449
|
-
static CONTEXT = "?contextId=";
|
|
450
|
-
/**
|
|
451
|
-
* The query parameter to pass a document ID in API requests.
|
|
452
|
-
* @static
|
|
453
|
-
* @type {string}
|
|
454
|
-
*/
|
|
455
|
-
static DOCUMENT_TYPES = "documentTypes";
|
|
456
|
-
/**
|
|
457
|
-
* The query parameter to pass a context ID in API requests.
|
|
458
|
-
* @static
|
|
459
|
-
* @type {string}
|
|
460
|
-
*/
|
|
461
|
-
static FOLDERS = "/folders?contextId=";
|
|
462
|
-
/**
|
|
463
|
-
* The query parameter to pass a document ID in API requests.
|
|
464
|
-
* @static
|
|
465
|
-
* @type {string}
|
|
466
|
-
*/
|
|
467
|
-
static ALERT_BY_DOCUMENT_ID = "alerts?documentId=";
|
|
468
|
-
/**
|
|
469
|
-
* The query parameter to pass a document ID in API requests.
|
|
470
|
-
* @static
|
|
471
|
-
* @type {string}
|
|
472
|
-
*/
|
|
473
|
-
static PARENT_DOCUMENT_TYPE_ID = "parentDocumentType?parentDocumentTypeId=";
|
|
474
|
-
/**
|
|
475
|
-
* The query parameter to pass a context ID in API requests.
|
|
476
|
-
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
477
|
-
* @static
|
|
478
|
-
* @type {string}
|
|
479
|
-
*/
|
|
480
|
-
static CONTEXT_ID = "&contextId=";
|
|
481
|
-
}
|
|
482
|
-
|
|
483
486
|
/**
|
|
484
487
|
* Service that handles loading and providing configuration settings for the application.
|
|
485
488
|
* It fetches configuration data from a remote server and exposes various configuration options.
|
|
@@ -635,7 +638,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
635
638
|
* This class extends Akita's `QueryEntity` to provide additional functionality for querying document data.
|
|
636
639
|
* @class DocumentQuery
|
|
637
640
|
* @typedef {DocumentQuery}
|
|
638
|
-
* @
|
|
641
|
+
* @extends {QueryEntity<DocumentState>}
|
|
639
642
|
*/
|
|
640
643
|
class DocumentQuery extends QueryEntity {
|
|
641
644
|
store;
|
|
@@ -664,13 +667,6 @@ class DocumentQuery extends QueryEntity {
|
|
|
664
667
|
selectMessages() {
|
|
665
668
|
return this.select((state) => state.messages);
|
|
666
669
|
}
|
|
667
|
-
/**
|
|
668
|
-
* Selects the set documents.
|
|
669
|
-
* @returns {Observable<DocumentModel[]>} Observable that emits the documets.
|
|
670
|
-
*/
|
|
671
|
-
selectDocumets() {
|
|
672
|
-
return this.select((state) => state.documentList);
|
|
673
|
-
}
|
|
674
670
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
675
671
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, providedIn: 'root' });
|
|
676
672
|
}
|
|
@@ -714,6 +710,8 @@ class DocumentHttpService {
|
|
|
714
710
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
715
711
|
*/
|
|
716
712
|
getFoldersData(contextId) {
|
|
713
|
+
if (!contextId)
|
|
714
|
+
return EMPTY;
|
|
717
715
|
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}${URLS.FOLDERS}${contextId}`).pipe(tap((folders) => {
|
|
718
716
|
this.documentStore.setFolders(folders);
|
|
719
717
|
}), catchError((error) => {
|
|
@@ -757,6 +755,19 @@ class DocumentHttpService {
|
|
|
757
755
|
return throwError(() => new Error(error));
|
|
758
756
|
}));
|
|
759
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* Updates the name of a document.
|
|
760
|
+
* This method sends an HTTP PUT request to update the document's file name using the provided document ID and payload.
|
|
761
|
+
* In case of an error, it will return an observable that throws an Error.
|
|
762
|
+
* @param {string} documentId - The unique identifier of the document to update.
|
|
763
|
+
* @param {any} payload - The payload containing the updated document data (e.g., fileName).
|
|
764
|
+
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
765
|
+
*/
|
|
766
|
+
updateDocumentName(documentId, payload) {
|
|
767
|
+
return this.http.put(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${documentId}`, payload).pipe(catchError((error) => {
|
|
768
|
+
return throwError(() => new Error(error));
|
|
769
|
+
}));
|
|
770
|
+
}
|
|
760
771
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
761
772
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, providedIn: 'root' });
|
|
762
773
|
}
|
|
@@ -1255,55 +1266,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1255
1266
|
}]
|
|
1256
1267
|
}] });
|
|
1257
1268
|
|
|
1258
|
-
/**
|
|
1259
|
-
* Description placeholder
|
|
1260
|
-
* @class LinkedDocumentComponent
|
|
1261
|
-
* @typedef {LinkedDocumentComponent}
|
|
1262
|
-
* @implements {OnChanges}
|
|
1263
|
-
*/
|
|
1264
|
-
class LinkedDocumentComponent {
|
|
1265
|
-
/**
|
|
1266
|
-
* Selected document for view.
|
|
1267
|
-
* @type {?DocumentModel}
|
|
1268
|
-
*/
|
|
1269
|
-
selectedDocument;
|
|
1270
|
-
/**
|
|
1271
|
-
* Whole document list.
|
|
1272
|
-
* @type {?DocumentModel[]}
|
|
1273
|
-
*/
|
|
1274
|
-
documentList;
|
|
1275
|
-
/**
|
|
1276
|
-
* Changed selected document.
|
|
1277
|
-
* @type {*}
|
|
1278
|
-
*/
|
|
1279
|
-
selectedDocumentChange = new EventEmitter();
|
|
1280
|
-
/**
|
|
1281
|
-
* Filtered documents.
|
|
1282
|
-
* @type {DocumentModel[]}
|
|
1283
|
-
*/
|
|
1284
|
-
filteredDocuments = [];
|
|
1285
|
-
/**
|
|
1286
|
-
* Handle the click on the document.
|
|
1287
|
-
* @param {DocumentModel} document - Clicked document.
|
|
1288
|
-
*/
|
|
1289
|
-
handleDocumentClick(document) {
|
|
1290
|
-
this.selectedDocument = document;
|
|
1291
|
-
this.selectedDocumentChange.emit(this.selectedDocument);
|
|
1292
|
-
}
|
|
1293
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinkedDocumentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1294
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: LinkedDocumentComponent, isStandalone: false, selector: "app-linked-document", inputs: { selectedDocument: "selectedDocument", documentList: "documentList" }, outputs: { selectedDocumentChange: "selectedDocumentChange" }, ngImport: i0, template: "<div class=\"summary-card mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\"\r\n style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px; background-color: #F9fafb;\">\r\n <div class=\"p-0\">\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Linked Documents</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\">\r\n @for(document of documentList; track document){\r\n <div class=\"linkedDocument documentName m-2\">\r\n <div class=\"documentName\" [class.selected]=\"document._id === selectedDocument?._id\"\r\n (click)=\"handleDocumentClick(document)\">\r\n <span class=\"pi pi-link\"></span>\r\n {{document.fileName}}\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n \r\n \r\n </div>\r\n ", styles: [".documentName{font-family:inherit;text-decoration:underline;cursor:pointer;width:max-content}.selected{color:var(--primary-color)}\n"] });
|
|
1295
|
-
}
|
|
1296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinkedDocumentComponent, decorators: [{
|
|
1297
|
-
type: Component,
|
|
1298
|
-
args: [{ selector: 'app-linked-document', standalone: false, template: "<div class=\"summary-card mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\"\r\n style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px; background-color: #F9fafb;\">\r\n <div class=\"p-0\">\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Linked Documents</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\">\r\n @for(document of documentList; track document){\r\n <div class=\"linkedDocument documentName m-2\">\r\n <div class=\"documentName\" [class.selected]=\"document._id === selectedDocument?._id\"\r\n (click)=\"handleDocumentClick(document)\">\r\n <span class=\"pi pi-link\"></span>\r\n {{document.fileName}}\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n \r\n \r\n </div>\r\n ", styles: [".documentName{font-family:inherit;text-decoration:underline;cursor:pointer;width:max-content}.selected{color:var(--primary-color)}\n"] }]
|
|
1299
|
-
}], propDecorators: { selectedDocument: [{
|
|
1300
|
-
type: Input
|
|
1301
|
-
}], documentList: [{
|
|
1302
|
-
type: Input
|
|
1303
|
-
}], selectedDocumentChange: [{
|
|
1304
|
-
type: Output
|
|
1305
|
-
}] } });
|
|
1306
|
-
|
|
1307
1269
|
/**
|
|
1308
1270
|
* Component for viewing and managing document details.
|
|
1309
1271
|
* @class DocumentViewerComponent
|
|
@@ -1317,11 +1279,6 @@ class DocumentViewerComponent {
|
|
|
1317
1279
|
* @type {*}
|
|
1318
1280
|
*/
|
|
1319
1281
|
selectedDocument; // <-- Made optional to prevent undefined issues
|
|
1320
|
-
/**
|
|
1321
|
-
* Get the selected document by user.
|
|
1322
|
-
* @type {*}
|
|
1323
|
-
*/
|
|
1324
|
-
documentList; // <-- Made optional to prevent undefined issues
|
|
1325
1282
|
/**
|
|
1326
1283
|
* Indicates whether a checkbox is selected.
|
|
1327
1284
|
* @type {boolean}
|
|
@@ -1350,8 +1307,6 @@ class DocumentViewerComponent {
|
|
|
1350
1307
|
subscription = new Subscription();
|
|
1351
1308
|
/**
|
|
1352
1309
|
* Initializes a new instance of the DocumentViewerComponent.
|
|
1353
|
-
* @param {DocumentHttpService} documentHttpService - Handle the http service.
|
|
1354
|
-
* @param {DocumentService} documentService - Handle the states.
|
|
1355
1310
|
*/
|
|
1356
1311
|
constructor(documentHttpService, documentService) {
|
|
1357
1312
|
this.documentHttpService = documentHttpService;
|
|
@@ -1367,10 +1322,6 @@ class DocumentViewerComponent {
|
|
|
1367
1322
|
this.alertData = DocumentAlertList.find((res) => res.status === this.selectedDocument?.status);
|
|
1368
1323
|
}
|
|
1369
1324
|
}
|
|
1370
|
-
handleSelectedDocument(document) {
|
|
1371
|
-
this.selectedDocument = document;
|
|
1372
|
-
this.documentService.set(this.selectedDocument);
|
|
1373
|
-
}
|
|
1374
1325
|
/**
|
|
1375
1326
|
* Determines if the given content type is an image.
|
|
1376
1327
|
* @param {string | undefined} contentType - The MIME type of the content.
|
|
@@ -1383,15 +1334,13 @@ class DocumentViewerComponent {
|
|
|
1383
1334
|
this.subscription.unsubscribe();
|
|
1384
1335
|
}
|
|
1385
1336
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1386
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument"
|
|
1337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" *ngIf=\"alertData?.status !== 'Verified'\">\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n <ng-content select=\"[action-launcher]\"></ng-content>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#fff;border-radius:0}.uploadedImages{width:95%;height:100%;object-fit:contain}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.PdfViewerComponent, selector: "pdf-viewer", inputs: ["src", "c-maps-url", "page", "render-text", "render-text-mode", "original-size", "show-all", "stick-to-page", "zoom", "zoom-scale", "rotation", "external-link-target", "autoresize", "fit-to-page", "show-borders"], outputs: ["after-load-complete", "page-rendered", "pages-initialized", "text-layer-rendered", "error", "on-progress", "pageChange"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1387
1338
|
}
|
|
1388
1339
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, decorators: [{
|
|
1389
1340
|
type: Component,
|
|
1390
|
-
args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }
|
|
1341
|
+
args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"left-part col-12 md:col-3 pt-0\">\r\n <div class=\"alerts mb-4 pb-1\">\r\n <button\r\n type=\"button\"\r\n *ngIf=\"\r\n (alertData?.status !== 'Pending' && !!alertData?.status) ||\r\n alertData?.isAlert === false\r\n \"\r\n class=\"bg-green-500 border-none border-round-md flex align-items-center mb-3 p-2 px-3\"\r\n >\r\n <i\r\n class=\"pi pi-verified mr-2 cursor-pointer\"\r\n [ngStyle]=\"{\r\n color:\r\n alertData?.status === 'Pending' &&\r\n alertData?.isAlert !== false\r\n ? '#FFFFFF'\r\n : '#8A8EA6'\r\n }\"\r\n style=\"font-size: 20px\"\r\n ></i>\r\n <span class=\"font-semibold text-white\">Verified</span>\r\n </button>\r\n <div\r\n class=\"card mb-0\"\r\n [ngClass]=\"\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? 'alert-card'\r\n : 'success-alert'\r\n \"\r\n >\r\n <div class=\"flex align-items-center mb-2 pb-1\" *ngIf=\"alertData?.status !== 'Verified'\">\r\n <h4 class=\"mr-3 mt-0 mb-0 text-color font-bold\" style=\"font-size: 21px; font-weight: bold; border-color: rgba(68, 72, 109, 0.2) ;\" >Alerts</h4>\r\n <i\r\n class=\"pi pi-exclamation-triangle\"\r\n style=\"font-size: 20px\"\r\n [ngStyle]=\"{\r\n color:\r\n (alertData?.status === 'Pending' || !alertData?.status) &&\r\n alertData?.isAlert !== false\r\n ? '#FB392D'\r\n : '#8A8EA6'\r\n }\"\r\n ></i>\r\n </div>\r\n <p class=\"text-color mb-0\">{{ alertData?.alertMessage }}</p>\r\n </div>\r\n </div>\r\n <ng-content select=\"[action-launcher]\"></ng-content>\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header,.document-viewer .p-dialog-content{background-color:#fff;border-radius:0}.uploadedImages{width:95%;height:100%;object-fit:contain}\n"] }]
|
|
1391
1342
|
}], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentService }], propDecorators: { selectedDocument: [{
|
|
1392
1343
|
type: Input
|
|
1393
|
-
}], documentList: [{
|
|
1394
|
-
type: Input
|
|
1395
1344
|
}] } });
|
|
1396
1345
|
|
|
1397
1346
|
/**
|
|
@@ -1607,7 +1556,16 @@ class DocumentListComponent {
|
|
|
1607
1556
|
* @memberof DocumentListComponent
|
|
1608
1557
|
*/
|
|
1609
1558
|
selectedOption = null;
|
|
1559
|
+
/**
|
|
1560
|
+
* The set of permissions available for this component.
|
|
1561
|
+
*/
|
|
1610
1562
|
PERMISSION = PERMISSIONS;
|
|
1563
|
+
/**
|
|
1564
|
+
* The file name associated with the document.
|
|
1565
|
+
* It may be undefined until a file is selected or loaded.
|
|
1566
|
+
* @type {string | undefined}
|
|
1567
|
+
*/
|
|
1568
|
+
fileName;
|
|
1611
1569
|
/**
|
|
1612
1570
|
* Creates an instance of DocumentListComponent.
|
|
1613
1571
|
* @class
|
|
@@ -1648,14 +1606,30 @@ class DocumentListComponent {
|
|
|
1648
1606
|
handleClickForDocument(document) {
|
|
1649
1607
|
this.isdialogVisible = SHARED.TRUE;
|
|
1650
1608
|
this.selectedDocument = document;
|
|
1609
|
+
this.fileName = document.fileName;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Handles the save click event to update the document's file name.
|
|
1613
|
+
* This method creates a payload with the updated file name and calls the
|
|
1614
|
+
* updateDocumentName() method from the documentHttpService. On a successful update,
|
|
1615
|
+
* it logs a message with the document's ID.
|
|
1616
|
+
* @returns {void}
|
|
1617
|
+
*/
|
|
1618
|
+
handleSaveClick() {
|
|
1619
|
+
const payload = { fileName: this.fileName };
|
|
1620
|
+
this.documentHttpService.updateDocumentName(this.selectedDocument._id, payload)
|
|
1621
|
+
.subscribe((res) => {
|
|
1622
|
+
console.log(`${SHARED.UPDATE_DOCUMENT_NAME} ${this.selectedDocument._id}`);
|
|
1623
|
+
});
|
|
1651
1624
|
}
|
|
1652
1625
|
/**
|
|
1653
1626
|
* Closes the dialog and resets the selected document.
|
|
1654
1627
|
* @memberof DocumentListComponent
|
|
1655
1628
|
*/
|
|
1656
|
-
|
|
1629
|
+
handleCloseModal() {
|
|
1657
1630
|
this.selectedDocument = { _id: SHARED.EMPTY };
|
|
1658
1631
|
this.isdialogVisible = SHARED.FALSE;
|
|
1632
|
+
this.onRefresh.emit();
|
|
1659
1633
|
}
|
|
1660
1634
|
/**
|
|
1661
1635
|
* Handles the upload action for a document.
|
|
@@ -1718,11 +1692,11 @@ class DocumentListComponent {
|
|
|
1718
1692
|
this.isSidebarVisible = isVisible;
|
|
1719
1693
|
}
|
|
1720
1694
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
1721
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList" }, outputs: { onRefresh: "onRefresh" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"
|
|
1695
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList" }, outputs: { onRefresh: "onRefresh" }, ngImport: i0, template: "\r\n<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModal()\"\r\n class=\"w-full h-full document-dailog-wrapper\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input \r\n type=\"text\" \r\n class=\"w-full border-none bg-white h-3rem file-input-wrapper\"\r\n pInputText \r\n [(ngModel)]=\"fileName\" />\r\n <button \r\n pButton \r\n pRipple \r\n class=\"mx-3 w-6rem save-btn-wrapper\"\r\n label=\"Save\"\r\n (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}\n"], dependencies: [{ kind: "component", type: i5$1.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i5$1.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i7.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i8$1.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "component", type: i9.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i10.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: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i10.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i11.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", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { 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", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i13.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: DocumentListItemComponent, selector: "lib-document-list-item", inputs: ["document"], outputs: ["documentClick"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1722
1696
|
}
|
|
1723
1697
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
1724
1698
|
type: Component,
|
|
1725
|
-
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"
|
|
1699
|
+
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "\r\n<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModal()\"\r\n class=\"w-full h-full document-dailog-wrapper\"\r\n [draggable]=\"false\" [closable]=\"true\">\r\n\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input \r\n type=\"text\" \r\n class=\"w-full border-none bg-white h-3rem file-input-wrapper\"\r\n pInputText \r\n [(ngModel)]=\"fileName\" />\r\n <button \r\n pButton \r\n pRipple \r\n class=\"mx-3 w-6rem save-btn-wrapper\"\r\n label=\"Save\"\r\n (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n\r\n <document-viewer [selectedDocument]=\"selectedDocument\">\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion>\r\n <p-accordionTab [selected]=\"true\" class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\" label=\"Upload File\"\r\n style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}\n"] }]
|
|
1726
1700
|
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }], propDecorators: { onRefresh: [{
|
|
1727
1701
|
type: Output
|
|
1728
1702
|
}], contextId: [{
|
|
@@ -1739,19 +1713,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1739
1713
|
* @typedef {DocumentContainerComponent}
|
|
1740
1714
|
*/
|
|
1741
1715
|
class DocumentContainerComponent {
|
|
1742
|
-
documentStore;
|
|
1743
1716
|
documentService;
|
|
1744
1717
|
documentQuery;
|
|
1745
1718
|
documentHttpService;
|
|
1746
1719
|
/**
|
|
1747
1720
|
* Creates an instance of DocumentContainerComponent.
|
|
1748
|
-
* @param {DocumentStore} documentStore - Query Store service to manage store document-related state.
|
|
1749
1721
|
* @param {DocumentService} documentService - Service to manage document-related operations.
|
|
1750
1722
|
* @param {DocumentQuery} documentQuery - Query service to manage document-related state.
|
|
1751
1723
|
* @param {DocumentHttpService} documentHttpService - Service to make HTTP requests related to documents.
|
|
1752
1724
|
*/
|
|
1753
|
-
constructor(
|
|
1754
|
-
this.documentStore = documentStore;
|
|
1725
|
+
constructor(documentService, documentQuery, documentHttpService) {
|
|
1755
1726
|
this.documentService = documentService;
|
|
1756
1727
|
this.documentQuery = documentQuery;
|
|
1757
1728
|
this.documentHttpService = documentHttpService;
|
|
@@ -1812,9 +1783,9 @@ class DocumentContainerComponent {
|
|
|
1812
1783
|
* @returns {void}
|
|
1813
1784
|
*/
|
|
1814
1785
|
/**
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1786
|
+
* Fetches the folder data from the API.
|
|
1787
|
+
* @returns {void}
|
|
1788
|
+
*/
|
|
1818
1789
|
fetchFolder() {
|
|
1819
1790
|
const folderSubscription = this.documentHttpService.getFoldersData(this.contextId).subscribe({
|
|
1820
1791
|
/**
|
|
@@ -1859,7 +1830,6 @@ class DocumentContainerComponent {
|
|
|
1859
1830
|
next: (documentList) => {
|
|
1860
1831
|
if (documentList) {
|
|
1861
1832
|
this.documentList = documentList;
|
|
1862
|
-
this.documentStore.setDocumentList(documentList);
|
|
1863
1833
|
}
|
|
1864
1834
|
else {
|
|
1865
1835
|
console.error(ERRORS.ERROR_FETCHING_DOCUMENTS);
|
|
@@ -1881,13 +1851,13 @@ class DocumentContainerComponent {
|
|
|
1881
1851
|
ngOnDestroy() {
|
|
1882
1852
|
this.subscription.unsubscribe();
|
|
1883
1853
|
}
|
|
1884
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token:
|
|
1854
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentService$1 }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1885
1855
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId", showFolderList: "showFolderList", isUploadButtonVisible: "isUploadButtonVisible" }, ngImport: i0, template: "<div class=\"grid m-0 h-full\">\r\n <div class=\"col-12 md:col-12 lg:col-12 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "isUploadButtonVisible", "documentList"], outputs: ["onRefresh"] }] });
|
|
1886
1856
|
}
|
|
1887
1857
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
1888
1858
|
type: Component,
|
|
1889
1859
|
args: [{ selector: 'lib-document-container', standalone: false, template: "<div class=\"grid m-0 h-full\">\r\n <div class=\"col-12 md:col-12 lg:col-12 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"] }]
|
|
1890
|
-
}], ctorParameters: () => [{ type:
|
|
1860
|
+
}], ctorParameters: () => [{ type: DocumentService$1 }, { type: DocumentQuery }, { type: DocumentHttpService }], propDecorators: { contextId: [{
|
|
1891
1861
|
type: Input
|
|
1892
1862
|
}], showFolderList: [{
|
|
1893
1863
|
type: Input
|
|
@@ -2011,13 +1981,9 @@ class DocumentModule {
|
|
|
2011
1981
|
*/
|
|
2012
1982
|
DocumentDirective,
|
|
2013
1983
|
/**
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
HasPermissionDirective,
|
|
2017
|
-
/**
|
|
2018
|
-
* A component which have linked documents.
|
|
2019
|
-
*/
|
|
2020
|
-
LinkedDocumentComponent], imports: [
|
|
1984
|
+
* A directive to give permission.
|
|
1985
|
+
*/
|
|
1986
|
+
HasPermissionDirective], imports: [
|
|
2021
1987
|
/**
|
|
2022
1988
|
* Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
|
|
2023
1989
|
*/
|
|
@@ -2087,8 +2053,8 @@ class DocumentModule {
|
|
|
2087
2053
|
*/
|
|
2088
2054
|
InputTextModule], exports: [
|
|
2089
2055
|
/**
|
|
2090
|
-
|
|
2091
|
-
|
|
2056
|
+
* A directive to give permission.
|
|
2057
|
+
*/
|
|
2092
2058
|
HasPermissionDirective,
|
|
2093
2059
|
/**
|
|
2094
2060
|
* Exports the `DocumentContainerComponent` to be used in other modules.
|
|
@@ -2137,7 +2103,7 @@ class DocumentModule {
|
|
|
2137
2103
|
}),
|
|
2138
2104
|
deps: [AppConfigService],
|
|
2139
2105
|
multi: true,
|
|
2140
|
-
}
|
|
2106
|
+
}
|
|
2141
2107
|
], imports: [
|
|
2142
2108
|
/**
|
|
2143
2109
|
* Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
|
|
@@ -2250,13 +2216,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2250
2216
|
*/
|
|
2251
2217
|
DocumentDirective,
|
|
2252
2218
|
/**
|
|
2253
|
-
|
|
2254
|
-
|
|
2219
|
+
* A directive to give permission.
|
|
2220
|
+
*/
|
|
2255
2221
|
HasPermissionDirective,
|
|
2256
|
-
/**
|
|
2257
|
-
* A component which have linked documents.
|
|
2258
|
-
*/
|
|
2259
|
-
LinkedDocumentComponent,
|
|
2260
2222
|
],
|
|
2261
2223
|
imports: [
|
|
2262
2224
|
/**
|
|
@@ -2330,8 +2292,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2330
2292
|
],
|
|
2331
2293
|
exports: [
|
|
2332
2294
|
/**
|
|
2333
|
-
|
|
2334
|
-
|
|
2295
|
+
* A directive to give permission.
|
|
2296
|
+
*/
|
|
2335
2297
|
HasPermissionDirective,
|
|
2336
2298
|
/**
|
|
2337
2299
|
* Exports the `DocumentContainerComponent` to be used in other modules.
|
|
@@ -2381,7 +2343,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2381
2343
|
}),
|
|
2382
2344
|
deps: [AppConfigService],
|
|
2383
2345
|
multi: true,
|
|
2384
|
-
}
|
|
2346
|
+
}
|
|
2385
2347
|
]
|
|
2386
2348
|
}]
|
|
2387
2349
|
}] });
|