cat-documents-ng 0.2.40 → 0.2.42
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/Shared/components/table-primary/table-primary.component.d.ts +2 -1
- package/Shared/constant/SHARED.d.ts +35 -0
- package/Shared/constant/URLS.d.ts +8 -0
- package/Shared/shared.module.d.ts +6 -5
- package/fesm2022/cat-documents-ng.mjs +825 -236
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-actions/document-actions.component.d.ts +35 -0
- package/lib/document/components/document-list/document-list.component.d.ts +12 -1
- package/lib/document/components/document-search/document-search.component.d.ts +35 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +57 -4
- package/lib/document/document.module.d.ts +29 -28
- package/lib/document/models/document-list-response.model.d.ts +2 -0
- package/lib/document/services/document-actions.service.d.ts +48 -0
- package/lib/document/services/document-http.service.d.ts +21 -0
- package/lib/document/services/document.service.d.ts +7 -1
- package/lib/document/state/document.query.d.ts +9 -2
- package/lib/document/state/document.state.d.ts +1 -0
- package/lib/document/state/document.store.d.ts +2 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Output, Input, Component, ViewChild, ViewEncapsulation,
|
|
3
|
-
import * as
|
|
2
|
+
import { Injectable, EventEmitter, Output, Input, Component, Directive, ViewChild, ViewEncapsulation, NgModule, APP_INITIALIZER } from '@angular/core';
|
|
3
|
+
import * as i2$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { firstValueFrom, tap, EMPTY, catchError, throwError, of, combineLatest, Subscription } from 'rxjs';
|
|
5
|
+
import { firstValueFrom, tap, EMPTY, catchError, throwError, of, combineLatest, Subscription, Subject, takeUntil, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1 } 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';
|
|
9
|
-
import { HttpParams, HttpClientModule } from '@angular/common/http';
|
|
9
|
+
import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
10
10
|
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
|
11
11
|
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
12
|
-
import * as i3 from '
|
|
12
|
+
import * as i3 from '@angular/forms';
|
|
13
|
+
import { FormsModule } from '@angular/forms';
|
|
14
|
+
import * as i3$1 from 'primeng/api';
|
|
13
15
|
import { MessageService } from 'primeng/api';
|
|
14
|
-
import * as
|
|
16
|
+
import * as i4 from 'primeng/button';
|
|
15
17
|
import { ButtonModule } from 'primeng/button';
|
|
16
|
-
import * as
|
|
18
|
+
import * as i10 from 'primeng/sidebar';
|
|
17
19
|
import { SidebarModule } from 'primeng/sidebar';
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
20
|
-
import { FormsModule } from '@angular/forms';
|
|
21
|
-
import * as i12 from 'primeng/dialog';
|
|
20
|
+
import * as i5$2 from 'primeng/messages';
|
|
21
|
+
import * as i7$1 from 'primeng/dialog';
|
|
22
22
|
import { DialogModule } from 'primeng/dialog';
|
|
23
|
-
import * as
|
|
23
|
+
import * as i14 from 'primeng/dropdown';
|
|
24
24
|
import { DropdownModule } from 'primeng/dropdown';
|
|
25
|
-
import * as
|
|
25
|
+
import * as i15 from 'primeng/inputtext';
|
|
26
26
|
import { InputTextModule } from 'primeng/inputtext';
|
|
27
|
-
import * as i2$
|
|
27
|
+
import * as i2$2 from 'primeng/table';
|
|
28
28
|
import { TableModule } from 'primeng/table';
|
|
29
|
-
import * as i5
|
|
29
|
+
import * as i5 from 'primeng/ripple';
|
|
30
30
|
import { RippleModule } from 'primeng/ripple';
|
|
31
|
+
import * as i1 from '@angular/router';
|
|
31
32
|
import * as i7 from 'primeng/fileupload';
|
|
32
33
|
import { FileUploadModule } from 'primeng/fileupload';
|
|
33
|
-
import * as i8
|
|
34
|
+
import * as i8 from 'primeng/progressbar';
|
|
34
35
|
import { ProgressBarModule } from 'primeng/progressbar';
|
|
35
|
-
import * as
|
|
36
|
+
import * as i6 from 'ng2-pdf-viewer';
|
|
36
37
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
|
37
|
-
import * as i3$
|
|
38
|
+
import * as i3$2 from 'primeng/accordion';
|
|
38
39
|
import { AccordionModule } from 'primeng/accordion';
|
|
39
|
-
import * as
|
|
40
|
+
import * as i5$1 from 'primeng/inputtextarea';
|
|
41
|
+
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
42
|
+
import * as i7$2 from 'primeng/badge';
|
|
40
43
|
import { BadgeModule } from 'primeng/badge';
|
|
41
|
-
import * as i8$
|
|
44
|
+
import * as i8$1 from 'primeng/menu';
|
|
42
45
|
import { MenuModule } from 'primeng/menu';
|
|
43
|
-
import * as i9
|
|
46
|
+
import * as i9 from 'primeng/card';
|
|
44
47
|
import { CardModule } from 'primeng/card';
|
|
45
48
|
import { ListboxModule } from 'primeng/listbox';
|
|
46
49
|
import { TimelineModule } from 'primeng/timeline';
|
|
47
50
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
48
|
-
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
49
|
-
import * as i1 from '@angular/router';
|
|
50
51
|
import { PanelMenuModule } from 'primeng/panelmenu';
|
|
51
52
|
|
|
52
53
|
/**
|
|
@@ -62,6 +63,7 @@ class SHARED {
|
|
|
62
63
|
* Represents the info.
|
|
63
64
|
*/
|
|
64
65
|
static HIDDEN = 'hidden';
|
|
66
|
+
static DOCUMENT_TYPES_DELETE = 'DocumentTypes-DELETE';
|
|
65
67
|
/**
|
|
66
68
|
* Represents the info.
|
|
67
69
|
*/
|
|
@@ -434,6 +436,45 @@ class SHARED {
|
|
|
434
436
|
static DOCUMENT_UPLOADED = 'document-uploaded';
|
|
435
437
|
static DOCUMENT_REJECTED = 'document-rejected';
|
|
436
438
|
static DOCUMENT_ACCEPTED = 'document-accepted';
|
|
439
|
+
// Document Actions Constants
|
|
440
|
+
static ACCEPT_ACTION = 'accept';
|
|
441
|
+
static REJECT_ACTION = 'reject';
|
|
442
|
+
static DELETE_ACTION = 'delete';
|
|
443
|
+
static ACCEPT_CONFIRM_HEADER = 'Accept confirm';
|
|
444
|
+
static REJECT_CONFIRM_HEADER = 'Reject Confirm';
|
|
445
|
+
static ACCEPT_NOTE_LABEL = 'Write a note for Acceptance';
|
|
446
|
+
static REJECT_NOTE_LABEL = 'Write a note for rejection';
|
|
447
|
+
static ACCEPT_NOTE_PLACEHOLDER = 'Write a note for Acceptance';
|
|
448
|
+
static REJECT_NOTE_PLACEHOLDER = 'Write a note for rejection';
|
|
449
|
+
static CANCEL_BUTTON_LABEL = 'Cancel';
|
|
450
|
+
static ACCEPT_BUTTON_LABEL = 'Accept';
|
|
451
|
+
static REJECT_BUTTON_LABEL = 'Reject';
|
|
452
|
+
static DOCUMENT_ACCEPTED_MESSAGE = 'Document accepted successfully';
|
|
453
|
+
static DOCUMENT_REJECTED_MESSAGE = 'Document rejected successfully';
|
|
454
|
+
static DOCUMENT_UPDATE_ERROR_MESSAGE = 'Failed to update document. Please try again.';
|
|
455
|
+
static STATUS_APPROVED = 'Approved';
|
|
456
|
+
static STATUS_REJECTED = 'Rejected';
|
|
457
|
+
// Document Status Constants
|
|
458
|
+
static STATUS_PENDING = 'pending';
|
|
459
|
+
static STATUS_ACCEPTED = 'accepted';
|
|
460
|
+
static STATUS_REJECTED_LOWERCASE = 'rejected';
|
|
461
|
+
static STATUS_DECLINED = 'declined';
|
|
462
|
+
// Document Card CSS Classes
|
|
463
|
+
static CARD_PENDING = 'pending-card';
|
|
464
|
+
static CARD_ACCEPTED = 'accepted-card';
|
|
465
|
+
static CARD_REJECTED = 'rejected-card';
|
|
466
|
+
// Document Button CSS Classes
|
|
467
|
+
static BUTTON_SECONDARY_REJECT = 'secondary-reject';
|
|
468
|
+
static BUTTON_PRIMARY_REJECT = 'primary-reject';
|
|
469
|
+
static BUTTON_DEFAULT_REJECT = 'default-reject';
|
|
470
|
+
static BUTTON_PRIMARY_ACCEPT = 'primary-accept';
|
|
471
|
+
static BUTTON_SECONDARY_ACCEPT = 'secondary-accept';
|
|
472
|
+
static BUTTON_DEFAULT_ACCEPT = 'default-accept';
|
|
473
|
+
// Document Action Button Labels
|
|
474
|
+
static BUTTON_LABEL_REJECT = 'Reject';
|
|
475
|
+
static BUTTON_LABEL_REJECTED = 'Rejected';
|
|
476
|
+
static BUTTON_LABEL_ACCEPT = 'Accept';
|
|
477
|
+
static BUTTON_LABEL_ACCEPTED = 'Accepted';
|
|
437
478
|
}
|
|
438
479
|
/**
|
|
439
480
|
* `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
|
|
@@ -567,7 +608,13 @@ const COUNTRIES = [
|
|
|
567
608
|
* @type {{}}
|
|
568
609
|
*/
|
|
569
610
|
const SUPPORTED_IMAGE_TYPES = [
|
|
570
|
-
'image/png'
|
|
611
|
+
'image/png',
|
|
612
|
+
'image/jpeg',
|
|
613
|
+
'image/jpg',
|
|
614
|
+
'image/gif',
|
|
615
|
+
'image/bmp',
|
|
616
|
+
'image/tiff',
|
|
617
|
+
'image/webp',
|
|
571
618
|
];
|
|
572
619
|
/**
|
|
573
620
|
* @constant {Array<{label: string, value: string, files: string[]}>} DOCUMENTTYPES
|
|
@@ -738,6 +785,7 @@ function createInitialState() {
|
|
|
738
785
|
selectedMenuItem: null,
|
|
739
786
|
selectedUserId: null,
|
|
740
787
|
selectedStatus: null,
|
|
788
|
+
searchKey: null,
|
|
741
789
|
showUserList: true,
|
|
742
790
|
currentDocument: null,
|
|
743
791
|
userList: [],
|
|
@@ -794,12 +842,16 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
794
842
|
setSelectedStatus(status) {
|
|
795
843
|
this.update({ selectedStatus: status });
|
|
796
844
|
}
|
|
845
|
+
setSearchKey(searchKey) {
|
|
846
|
+
this.update({ searchKey: searchKey });
|
|
847
|
+
}
|
|
797
848
|
// Method to update all selection properties at once
|
|
798
|
-
setSelectionState(menuItem, userId, status) {
|
|
849
|
+
setSelectionState(menuItem, userId, status, searchKey = null) {
|
|
799
850
|
this.update({
|
|
800
851
|
selectedMenuItem: menuItem,
|
|
801
852
|
selectedUserId: userId,
|
|
802
|
-
selectedStatus: status
|
|
853
|
+
selectedStatus: status,
|
|
854
|
+
searchKey: searchKey
|
|
803
855
|
});
|
|
804
856
|
}
|
|
805
857
|
// Method to clear all selection state
|
|
@@ -808,6 +860,7 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
808
860
|
selectedMenuItem: null,
|
|
809
861
|
selectedUserId: null,
|
|
810
862
|
selectedStatus: null,
|
|
863
|
+
searchKey: null,
|
|
811
864
|
showUserList: true
|
|
812
865
|
});
|
|
813
866
|
}
|
|
@@ -863,6 +916,13 @@ class URLS {
|
|
|
863
916
|
* @type {string}
|
|
864
917
|
*/
|
|
865
918
|
static DOCUMENT_UPLOAD = "Documents";
|
|
919
|
+
/**
|
|
920
|
+
* The URL endpoint for document uploads.
|
|
921
|
+
* Used to send documents to the server for storage or processing.
|
|
922
|
+
* @static
|
|
923
|
+
* @type {string}
|
|
924
|
+
*/
|
|
925
|
+
static DOCUMENTS = "documents";
|
|
866
926
|
/**
|
|
867
927
|
* The URL endpoint for document uploads.
|
|
868
928
|
* Used to send documents to the server for storage or processing.
|
|
@@ -924,6 +984,7 @@ class URLS {
|
|
|
924
984
|
static GETALL = "documents/getAllByContextId";
|
|
925
985
|
static DOCUMENT_LIST = "list";
|
|
926
986
|
static DOCUMENT_HISTORY = "documents/getDocumentHistoryByDocumentId/";
|
|
987
|
+
static DELETE_DOCUMENT = "documents/deleteDocumentByDocumentId/";
|
|
927
988
|
}
|
|
928
989
|
|
|
929
990
|
/**
|
|
@@ -1147,15 +1208,23 @@ class DocumentQuery extends QueryEntity {
|
|
|
1147
1208
|
return this.select((state) => state.selectedStatus);
|
|
1148
1209
|
}
|
|
1149
1210
|
/**
|
|
1150
|
-
* Selects
|
|
1151
|
-
* @returns {Observable<
|
|
1211
|
+
* Selects the current search key.
|
|
1212
|
+
* @returns {Observable<string | null>} Observable that emits the current search key.
|
|
1213
|
+
*/
|
|
1214
|
+
selectSearchKey() {
|
|
1215
|
+
return this.select((state) => state.searchKey);
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Selects all selection state properties (menu item, user ID, status, search key).
|
|
1219
|
+
* @returns {Observable<{menuItem: string | null, userId: string | null, status: string | null, searchKey: string | null}>} Observable that emits the current selection state.
|
|
1152
1220
|
* Note: menuItem is the _id of the selected menu item, not the label.
|
|
1153
1221
|
*/
|
|
1154
1222
|
selectSelectionState() {
|
|
1155
1223
|
return this.select((state) => ({
|
|
1156
1224
|
menuItem: state.selectedMenuItem,
|
|
1157
1225
|
userId: state.selectedUserId,
|
|
1158
|
-
status: state.selectedStatus
|
|
1226
|
+
status: state.selectedStatus,
|
|
1227
|
+
searchKey: state.searchKey
|
|
1159
1228
|
}));
|
|
1160
1229
|
}
|
|
1161
1230
|
/**
|
|
@@ -1168,7 +1237,8 @@ class DocumentQuery extends QueryEntity {
|
|
|
1168
1237
|
return {
|
|
1169
1238
|
menuItem: state.selectedMenuItem,
|
|
1170
1239
|
userId: state.selectedUserId,
|
|
1171
|
-
status: state.selectedStatus
|
|
1240
|
+
status: state.selectedStatus,
|
|
1241
|
+
searchKey: state.searchKey
|
|
1172
1242
|
};
|
|
1173
1243
|
}
|
|
1174
1244
|
/**
|
|
@@ -1301,7 +1371,9 @@ class DocumentHttpService {
|
|
|
1301
1371
|
getDocumentCatagories(contextId) {
|
|
1302
1372
|
if (!contextId)
|
|
1303
1373
|
return EMPTY;
|
|
1304
|
-
|
|
1374
|
+
let headers = new HttpHeaders({ Authorization: `Bearer 9b9a5353-875d-4214-957e-5d11fcee56ed
|
|
1375
|
+
` });
|
|
1376
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers }).pipe(tap((categories) => {
|
|
1305
1377
|
this.documentStore.setDocumentCategories(categories);
|
|
1306
1378
|
}), catchError((error) => {
|
|
1307
1379
|
return throwError(() => new Error(error));
|
|
@@ -1363,9 +1435,11 @@ class DocumentHttpService {
|
|
|
1363
1435
|
* @returns {Observable<UserListModel[]>} Observable that emits the user list data.
|
|
1364
1436
|
*/
|
|
1365
1437
|
getUserListByContextId(contextId) {
|
|
1438
|
+
let headers = new HttpHeaders({ Authorization: `Bearer 9b9a5353-875d-4214-957e-5d11fcee56ed
|
|
1439
|
+
` });
|
|
1366
1440
|
if (!contextId)
|
|
1367
1441
|
return EMPTY;
|
|
1368
|
-
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}
|
|
1442
|
+
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers }).pipe(tap((userList) => {
|
|
1369
1443
|
this.documentStore.setUserList(userList);
|
|
1370
1444
|
}), catchError((error) => {
|
|
1371
1445
|
return throwError(() => new Error(error));
|
|
@@ -1390,7 +1464,9 @@ class DocumentHttpService {
|
|
|
1390
1464
|
if (categoryId) {
|
|
1391
1465
|
params = params.set(SHARED.CATEGORY, categoryId);
|
|
1392
1466
|
}
|
|
1393
|
-
|
|
1467
|
+
let headers = new HttpHeaders({ Authorization: `Bearer 9b9a5353-875d-4214-957e-5d11fcee56ed
|
|
1468
|
+
` });
|
|
1469
|
+
return this.http.get(url, { params, headers }).pipe(tap((statusData) => {
|
|
1394
1470
|
this.documentStore.setStatusData(statusData);
|
|
1395
1471
|
}), catchError((error) => {
|
|
1396
1472
|
return throwError(() => new Error(error));
|
|
@@ -1420,7 +1496,9 @@ class DocumentHttpService {
|
|
|
1420
1496
|
if (searchKey) {
|
|
1421
1497
|
params = params.set(SHARED.SEARCH_KEY, searchKey);
|
|
1422
1498
|
}
|
|
1423
|
-
|
|
1499
|
+
let headers = new HttpHeaders({ Authorization: `Bearer 9b9a5353-875d-4214-957e-5d11fcee56ed
|
|
1500
|
+
` });
|
|
1501
|
+
return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params, headers }).pipe(tap((response) => {
|
|
1424
1502
|
if (response.documents) {
|
|
1425
1503
|
this.documentStore.setDocumentList(response.documents);
|
|
1426
1504
|
}
|
|
@@ -1432,7 +1510,68 @@ class DocumentHttpService {
|
|
|
1432
1510
|
if (!documentId) {
|
|
1433
1511
|
return of([]);
|
|
1434
1512
|
}
|
|
1435
|
-
|
|
1513
|
+
let headers = new HttpHeaders({ Authorization: `Bearer 9b9a5353-875d-4214-957e-5d11fcee56ed
|
|
1514
|
+
` });
|
|
1515
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers });
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Updates the status of a document by document ID
|
|
1519
|
+
* @param {string} documentId - The ID of the document to update
|
|
1520
|
+
* @param {string} status - The new status (Approved, Rejected, etc.)
|
|
1521
|
+
* @param {string} statusUpdateDescription - The description/note for the status update
|
|
1522
|
+
* @returns {Observable<any>} Observable that emits the updated document data with normalized status
|
|
1523
|
+
*/
|
|
1524
|
+
updateDocumentStatus(documentId, status, statusUpdateDescription) {
|
|
1525
|
+
const payload = {
|
|
1526
|
+
statusUpdateDescription: statusUpdateDescription
|
|
1527
|
+
};
|
|
1528
|
+
let headers = new HttpHeaders({ Authorization: `Bearer 9b9a5353-875d-4214-957e-5d11fcee56ed
|
|
1529
|
+
` });
|
|
1530
|
+
return this.http.put(`${this.apiUrl}${URLS.DOCUMENTS}/updateDocumentStatusByDocumentId/${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1531
|
+
console.log('Document status updated successfully:', response);
|
|
1532
|
+
// Normalize the response status to match component expectations
|
|
1533
|
+
if (response && response.status) {
|
|
1534
|
+
const normalizedStatus = this.normalizeStatus(response.status);
|
|
1535
|
+
response.normalizedStatus = normalizedStatus;
|
|
1536
|
+
}
|
|
1537
|
+
}), catchError((error) => {
|
|
1538
|
+
console.error('Error updating document status:', error);
|
|
1539
|
+
return throwError(() => new Error(error));
|
|
1540
|
+
}));
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* Normalizes the status from API response to match component expectations
|
|
1544
|
+
* @param {string} status - The status from API response (Approved, Rejected, etc.)
|
|
1545
|
+
* @returns {string} Normalized status value
|
|
1546
|
+
*/
|
|
1547
|
+
normalizeStatus(status) {
|
|
1548
|
+
switch (status.toLowerCase()) {
|
|
1549
|
+
case 'approved':
|
|
1550
|
+
return SHARED.STATUS_ACCEPTED;
|
|
1551
|
+
case 'rejected':
|
|
1552
|
+
return SHARED.STATUS_REJECTED_LOWERCASE;
|
|
1553
|
+
case 'pending':
|
|
1554
|
+
return SHARED.STATUS_PENDING;
|
|
1555
|
+
default:
|
|
1556
|
+
return status.toLowerCase();
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
/**
|
|
1560
|
+
* Deletes a document by its ID and refreshes the document list
|
|
1561
|
+
* @param {string} documentId - The ID of the document to delete
|
|
1562
|
+
* @param {string} contextId - The context ID to refresh the document list
|
|
1563
|
+
* @returns {Observable<any>} Observable that emits the delete response
|
|
1564
|
+
*/
|
|
1565
|
+
deleteDocument(documentId, contextId) {
|
|
1566
|
+
let headers = new HttpHeaders({ Authorization: `Bearer 9b9a5353-875d-4214-957e-5d11fcee56ed
|
|
1567
|
+
` });
|
|
1568
|
+
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1569
|
+
// After successful deletion, refresh the document list
|
|
1570
|
+
this.getDocumentsBySelection(contextId, null, null, null, null).subscribe();
|
|
1571
|
+
}), catchError((error) => {
|
|
1572
|
+
console.error('Error deleting document:', error);
|
|
1573
|
+
return throwError(() => new Error(error));
|
|
1574
|
+
}));
|
|
1436
1575
|
}
|
|
1437
1576
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHttpService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1438
1577
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHttpService, providedIn: 'root' });
|
|
@@ -1466,12 +1605,13 @@ class DocumentHelperService {
|
|
|
1466
1605
|
combineLatest([
|
|
1467
1606
|
this.documentQuery.selectSelectedMenuItem(),
|
|
1468
1607
|
this.documentQuery.selectSelectedUserId(),
|
|
1469
|
-
this.documentQuery.selectSelectedStatus()
|
|
1608
|
+
this.documentQuery.selectSelectedStatus(),
|
|
1609
|
+
this.documentQuery.selectSearchKey()
|
|
1470
1610
|
]).pipe(debounceTime(300), distinctUntilChanged((prev, curr) => {
|
|
1471
|
-
const isSame = prev[0] === curr[0] && prev[1] === curr[1] && prev[2] === curr[2];
|
|
1611
|
+
const isSame = prev[0] === curr[0] && prev[1] === curr[1] && prev[2] === curr[2] && prev[3] === curr[3];
|
|
1472
1612
|
return isSame;
|
|
1473
|
-
}), switchMap(([menuItem, userId, status]) => {
|
|
1474
|
-
return this.documentHttpService.getDocumentsBySelection(contextId, menuItem, userId, status);
|
|
1613
|
+
}), switchMap(([menuItem, userId, status, searchKey]) => {
|
|
1614
|
+
return this.documentHttpService.getDocumentsBySelection(contextId, menuItem, userId, status, searchKey);
|
|
1475
1615
|
})).subscribe({
|
|
1476
1616
|
next: (response) => {
|
|
1477
1617
|
const currentState = this.documentQuery.getSelectionState();
|
|
@@ -1539,14 +1679,22 @@ class DocumentHelperService {
|
|
|
1539
1679
|
setSelectedStatus(status) {
|
|
1540
1680
|
this.documentStore.setSelectedStatus(status);
|
|
1541
1681
|
}
|
|
1682
|
+
/**
|
|
1683
|
+
* Set the search key
|
|
1684
|
+
* @param searchKey the search term
|
|
1685
|
+
*/
|
|
1686
|
+
setSearchKey(searchKey) {
|
|
1687
|
+
this.documentStore.setSearchKey(searchKey);
|
|
1688
|
+
}
|
|
1542
1689
|
/**
|
|
1543
1690
|
* Set all selection state at once
|
|
1544
1691
|
* @param menuItem the selected menu item _id (not the label)
|
|
1545
1692
|
* @param userId the selected user ID
|
|
1546
1693
|
* @param status the selected status
|
|
1694
|
+
* @param searchKey the search term
|
|
1547
1695
|
*/
|
|
1548
|
-
setSelectionState(menuItem, userId, status) {
|
|
1549
|
-
this.documentStore.setSelectionState(menuItem, userId, status);
|
|
1696
|
+
setSelectionState(menuItem, userId, status, searchKey = null) {
|
|
1697
|
+
this.documentStore.setSelectionState(menuItem, userId, status, searchKey);
|
|
1550
1698
|
}
|
|
1551
1699
|
/**
|
|
1552
1700
|
* Clear all selection state
|
|
@@ -1793,7 +1941,7 @@ class UserListComponent {
|
|
|
1793
1941
|
}
|
|
1794
1942
|
}
|
|
1795
1943
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserListComponent, deps: [{ token: DocumentHelperService }, { token: DocumentStore }, { token: DocumentQuery }, { token: UserListService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1796
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UserListComponent, isStandalone: false, selector: "lib-user-list", inputs: { userList: "userList", categories: "categories" }, outputs: { userSelected: "userSelected" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"user-list-container\" [@slideInFromTop]>\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of filteredUserData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.name\"\r\n [style.border-color]=\"selectedUser === user.name ? '#f97316' : 'transparent'\"\r\n (click)=\"onUserSelect(user.name, user._id)\"\r\n >\r\n <div class=\"user-avatar\" [ngClass]=\"'avatar-' + user.color\">\r\n <span class=\"initials\">{{ user.initials }}</span>\r\n </div>\r\n <div class=\"user-info\">\r\n <div class=\"username\">{{ user.name }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approved }} approved / {{ user.pending }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.name\" [@fadeIn]>\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n \r\n <!-- Show message when filtered list is empty -->\r\n <div *ngIf=\"filteredUserData.length === 0 && shouldShowContainer\" class=\"no-users-message\" [@slideInFromTop]>\r\n <p>No users available for this category.</p>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem}.user-cards{display:flex;flex-wrap:wrap;gap:1rem;transition:all .3s ease-in-out}.user-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:330px;position:relative}.user-card:hover{box-shadow:0 4px 8px #00000026}.user-card.selected{background-color:#f8fafc;box-shadow:0 4px 8px #00000026;border-width:2px}.user-avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:14px}.avatar-orange{background-color:#f97316}.avatar-blue{background-color:#3b82f6}.avatar-green{background-color:#10b981}.avatar-grey{background-color:#6b7280}.avatar-purple{background-color:#8b5cf6}.user-info{flex:1}.username{font-weight:600;color:#1f2937;margin-bottom:.25rem}.document-counts{font-size:.875rem;color:#6b7280}.selection-indicator{position:absolute;top:8px;right:8px;width:20px;height:20px;background-color:#10b981;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px}.no-users-message{display:flex;justify-content:center;align-items:center;padding:2rem;background:#f8fafc;border-radius:8px;border:2px dashed #d1d5db;margin:1rem 0}.no-users-message p{color:#6b7280;font-size:.875rem;font-weight:500;margin:0;text-align:center}\n"], dependencies: [{ kind: "directive", type:
|
|
1944
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UserListComponent, isStandalone: false, selector: "lib-user-list", inputs: { userList: "userList", categories: "categories" }, outputs: { userSelected: "userSelected" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"user-list-container\" [@slideInFromTop]>\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of filteredUserData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.name\"\r\n [style.border-color]=\"selectedUser === user.name ? '#f97316' : 'transparent'\"\r\n (click)=\"onUserSelect(user.name, user._id)\"\r\n >\r\n <div class=\"user-avatar\" [ngClass]=\"'avatar-' + user.color\">\r\n <span class=\"initials\">{{ user.initials }}</span>\r\n </div>\r\n <div class=\"user-info\">\r\n <div class=\"username\">{{ user.name }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approved }} approved / {{ user.pending }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.name\" [@fadeIn]>\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n \r\n <!-- Show message when filtered list is empty -->\r\n <div *ngIf=\"filteredUserData.length === 0 && shouldShowContainer\" class=\"no-users-message\" [@slideInFromTop]>\r\n <p>No users available for this category.</p>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem}.user-cards{display:flex;flex-wrap:wrap;gap:1rem;transition:all .3s ease-in-out}.user-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:330px;position:relative}.user-card:hover{box-shadow:0 4px 8px #00000026}.user-card.selected{background-color:#f8fafc;box-shadow:0 4px 8px #00000026;border-width:2px}.user-avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:14px}.avatar-orange{background-color:#f97316}.avatar-blue{background-color:#3b82f6}.avatar-green{background-color:#10b981}.avatar-grey{background-color:#6b7280}.avatar-purple{background-color:#8b5cf6}.user-info{flex:1}.username{font-weight:600;color:#1f2937;margin-bottom:.25rem}.document-counts{font-size:.875rem;color:#6b7280}.selection-indicator{position:absolute;top:8px;right:8px;width:20px;height:20px;background-color:#10b981;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px}.no-users-message{display:flex;justify-content:center;align-items:center;padding:2rem;background:#f8fafc;border-radius:8px;border:2px dashed #d1d5db;margin:1rem 0}.no-users-message p{color:#6b7280;font-size:.875rem;font-weight:500;margin:0;text-align:center}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
|
|
1797
1945
|
trigger('slideInFromTop', [
|
|
1798
1946
|
state('void', style({
|
|
1799
1947
|
opacity: 0,
|
|
@@ -1923,7 +2071,7 @@ class DocumentStatusComponent {
|
|
|
1923
2071
|
this.statusDataWithPercentages = this.statusCalculatorService.calculateStatusDataWithPercentages(this.statusData, this.selectedStatus);
|
|
1924
2072
|
}
|
|
1925
2073
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStatusComponent, deps: [{ token: DocumentQuery }, { token: DocumentHelperService }, { token: StatusCalculatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1926
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentStatusComponent, isStandalone: false, selector: "lib-document-status", inputs: { contextId: "contextId", statusData: "statusData" }, ngImport: i0, template: "<div class=\"status-summary-container\">\r\n <div class=\"status-cards\">\r\n \r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"status-card {{ status.statusClass }}\"\r\n [class.selected]=\"status.isSelected\"\r\n (click)=\"selectStatus(status.status || '')\"\r\n >\r\n <div class=\"status-icon {{ status.iconClass }}\">\r\n <i [class]=\"status.icon\"></i>\r\n </div>\r\n <div class=\"status-info\">\r\n <div class=\"status-count\">{{ status.count }}</div>\r\n <div class=\"status-name\">{{ status.status }}</div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div class=\"progress-bar-container\">\r\n <div class=\"progress-bar\">\r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"progress-segment\"\r\n [style.width.%]=\"status.percentage\"\r\n [style.background-color]=\"status.color\"\r\n ></div>\r\n </div>\r\n </div>\r\n</div>", styles: [".status-summary-container{padding:1rem}.status-cards{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}.status-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border-radius:8px;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:150px;flex:1;cursor:pointer;transition:all .2s ease;border:2px solid transparent}.status-card:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.status-card.selected{border-width:3px!important;border-style:solid!important;box-shadow:0 4px 12px #0003}.status-card.selected.status-approved{border-color:#10b981!important;background:#ecfdf5!important}.status-card.selected.status-pending{border-color:#6b7280!important;background:#f8fafc!important}.status-card.selected.status-reviewing{border-color:#f59e0b!important;background:#fffbeb!important}.status-card.selected.status-rejected{border-color:#ef4444!important;background:#fff1f2!important}.status-card.selected.status-alert{border-color:#dc2626!important;background:#ef4444!important}.status-icon{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff}.icon-approved{background-color:#10b981}.icon-pending{background-color:#6b7280}.icon-reviewing{background-color:#f59e0b}.icon-rejected{background-color:#ef4444}.icon-alert{background-color:#dc2626}.status-info{flex:1}.status-name{font-weight:600;color:#1f2937;margin-bottom:.25rem}.status-count{font-size:1.5rem;font-weight:700;color:#374151}.progress-bar-container{margin-top:1rem}.progress-bar{height:8px;background-color:#e5e7eb;border-radius:4px;overflow:hidden;display:flex}.progress-segment{height:100%;transition:width .3s ease}\n"], dependencies: [{ kind: "directive", type:
|
|
2074
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentStatusComponent, isStandalone: false, selector: "lib-document-status", inputs: { contextId: "contextId", statusData: "statusData" }, ngImport: i0, template: "<div class=\"status-summary-container\">\r\n <div class=\"status-cards\">\r\n \r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"status-card {{ status.statusClass }}\"\r\n [class.selected]=\"status.isSelected\"\r\n (click)=\"selectStatus(status.status || '')\"\r\n >\r\n <div class=\"status-icon {{ status.iconClass }}\">\r\n <i [class]=\"status.icon\"></i>\r\n </div>\r\n <div class=\"status-info\">\r\n <div class=\"status-count\">{{ status.count }}</div>\r\n <div class=\"status-name\">{{ status.status }}</div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div class=\"progress-bar-container\">\r\n <div class=\"progress-bar\">\r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"progress-segment\"\r\n [style.width.%]=\"status.percentage\"\r\n [style.background-color]=\"status.color\"\r\n ></div>\r\n </div>\r\n </div>\r\n</div>", styles: [".status-summary-container{padding:1rem}.status-cards{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}.status-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border-radius:8px;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:150px;flex:1;cursor:pointer;transition:all .2s ease;border:2px solid transparent}.status-card:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.status-card.selected{border-width:3px!important;border-style:solid!important;box-shadow:0 4px 12px #0003}.status-card.selected.status-approved{border-color:#10b981!important;background:#ecfdf5!important}.status-card.selected.status-pending{border-color:#6b7280!important;background:#f8fafc!important}.status-card.selected.status-reviewing{border-color:#f59e0b!important;background:#fffbeb!important}.status-card.selected.status-rejected{border-color:#ef4444!important;background:#fff1f2!important}.status-card.selected.status-alert{border-color:#dc2626!important;background:#ef4444!important}.status-icon{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff}.icon-approved{background-color:#10b981}.icon-pending{background-color:#6b7280}.icon-reviewing{background-color:#f59e0b}.icon-rejected{background-color:#ef4444}.icon-alert{background-color:#dc2626}.status-info{flex:1}.status-name{font-weight:600;color:#1f2937;margin-bottom:.25rem}.status-count{font-size:1.5rem;font-weight:700;color:#374151}.progress-bar-container{margin-top:1rem}.progress-bar{height:8px;background-color:#e5e7eb;border-radius:4px;overflow:hidden;display:flex}.progress-segment{height:100%;transition:width .3s ease}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1927
2075
|
}
|
|
1928
2076
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStatusComponent, decorators: [{
|
|
1929
2077
|
type: Component,
|
|
@@ -1934,6 +2082,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1934
2082
|
type: Input
|
|
1935
2083
|
}] } });
|
|
1936
2084
|
|
|
2085
|
+
class DocumentSearchComponent {
|
|
2086
|
+
documentHelperService;
|
|
2087
|
+
SHARED = SHARED;
|
|
2088
|
+
contextId;
|
|
2089
|
+
searchTerm = '';
|
|
2090
|
+
destroy$ = new Subject();
|
|
2091
|
+
constructor(documentHelperService) {
|
|
2092
|
+
this.documentHelperService = documentHelperService;
|
|
2093
|
+
}
|
|
2094
|
+
ngOnInit() {
|
|
2095
|
+
this.setupSearchSubscription();
|
|
2096
|
+
}
|
|
2097
|
+
ngOnDestroy() {
|
|
2098
|
+
this.destroy$.next();
|
|
2099
|
+
this.destroy$.complete();
|
|
2100
|
+
}
|
|
2101
|
+
/**
|
|
2102
|
+
* Sets up the search input subscription with debouncing
|
|
2103
|
+
*/
|
|
2104
|
+
setupSearchSubscription() {
|
|
2105
|
+
// Create a subject to handle search term changes
|
|
2106
|
+
const searchSubject = new Subject();
|
|
2107
|
+
searchSubject.pipe(takeUntil(this.destroy$), debounceTime$1(500), // Wait 500ms after user stops typing
|
|
2108
|
+
distinctUntilChanged$1() // Only emit if value has changed
|
|
2109
|
+
).subscribe(searchTerm => {
|
|
2110
|
+
this.onSearchChange(searchTerm);
|
|
2111
|
+
});
|
|
2112
|
+
// Store the subject for use in template
|
|
2113
|
+
this.searchSubject = searchSubject;
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Handles search term changes from ngModel
|
|
2117
|
+
* @param searchTerm - The search term entered by the user
|
|
2118
|
+
*/
|
|
2119
|
+
onSearchInputChange(searchTerm) {
|
|
2120
|
+
this.searchSubject.next(searchTerm);
|
|
2121
|
+
}
|
|
2122
|
+
/**
|
|
2123
|
+
* Handles search term changes
|
|
2124
|
+
* @param searchTerm - The search term entered by the user
|
|
2125
|
+
*/
|
|
2126
|
+
onSearchChange(searchTerm) {
|
|
2127
|
+
// Normalize the search term (trim whitespace and convert to null if empty)
|
|
2128
|
+
const normalizedSearchTerm = searchTerm?.trim() || null;
|
|
2129
|
+
// Update the search key in the store
|
|
2130
|
+
this.documentHelperService.setSearchKey(normalizedSearchTerm);
|
|
2131
|
+
}
|
|
2132
|
+
/**
|
|
2133
|
+
* Clears the search input
|
|
2134
|
+
*/
|
|
2135
|
+
onClearSearch() {
|
|
2136
|
+
this.searchTerm = '';
|
|
2137
|
+
this.documentHelperService.setSearchKey(null);
|
|
2138
|
+
}
|
|
2139
|
+
// Subject for handling search input changes
|
|
2140
|
+
searchSubject = new Subject();
|
|
2141
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentSearchComponent, deps: [{ token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentSearchComponent, isStandalone: false, selector: "document-search", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"search-container\">\r\n <div class=\"search-input-wrapper\">\r\n <i class=\"pi pi-search search-icon\"></i>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchTerm\"\r\n (ngModelChange)=\"onSearchInputChange($event)\"\r\n class=\"search-input\"\r\n placeholder=\"Search by document name, category, type, status or applicant name...\"\r\n [attr.aria-label]=\"'Search documents'\"\r\n />\r\n <button \r\n *ngIf=\"searchTerm\"\r\n type=\"button\"\r\n class=\"clear-button\"\r\n (click)=\"onClearSearch()\"\r\n [attr.aria-label]=\"'Clear search'\"\r\n >\r\n <i class=\"pi pi-times\"></i>\r\n </button>\r\n </div>\r\n</div> ", styles: [".search-container{padding:1rem;background:#f8fafc;border-bottom:1px solid #e2e8f0}.search-input-wrapper{position:relative;width:40%;display:flex;align-items:center;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:.75rem 1rem;transition:all .2s ease;box-shadow:0 1px 3px #0000001a}.search-input-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.search-icon{color:#6b7280;margin-right:.75rem;font-size:1rem}.search-input{flex:1;border:none;outline:none;background:transparent;color:#374151}.search-input::placeholder{color:#9ca3af}.search-input:focus{outline:none}.clear-button{background:none;border:none;color:#6b7280;cursor:pointer;padding:.25rem;border-radius:4px;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.clear-button:hover{background-color:#f3f4f6;color:#374151}.clear-button:focus{outline:none;box-shadow:0 0 0 2px #3b82f633}.clear-button i{font-size:.875rem}@media (max-width: 768px){.search-container{padding:.75rem}.search-input-wrapper{padding:.5rem .75rem}.search-input{font-size:.8rem}}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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"] }] });
|
|
2143
|
+
}
|
|
2144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentSearchComponent, decorators: [{
|
|
2145
|
+
type: Component,
|
|
2146
|
+
args: [{ selector: 'document-search', standalone: false, template: "<div class=\"search-container\">\r\n <div class=\"search-input-wrapper\">\r\n <i class=\"pi pi-search search-icon\"></i>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchTerm\"\r\n (ngModelChange)=\"onSearchInputChange($event)\"\r\n class=\"search-input\"\r\n placeholder=\"Search by document name, category, type, status or applicant name...\"\r\n [attr.aria-label]=\"'Search documents'\"\r\n />\r\n <button \r\n *ngIf=\"searchTerm\"\r\n type=\"button\"\r\n class=\"clear-button\"\r\n (click)=\"onClearSearch()\"\r\n [attr.aria-label]=\"'Clear search'\"\r\n >\r\n <i class=\"pi pi-times\"></i>\r\n </button>\r\n </div>\r\n</div> ", styles: [".search-container{padding:1rem;background:#f8fafc;border-bottom:1px solid #e2e8f0}.search-input-wrapper{position:relative;width:40%;display:flex;align-items:center;background:#fff;border:1px solid #d1d5db;border-radius:8px;padding:.75rem 1rem;transition:all .2s ease;box-shadow:0 1px 3px #0000001a}.search-input-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.search-icon{color:#6b7280;margin-right:.75rem;font-size:1rem}.search-input{flex:1;border:none;outline:none;background:transparent;color:#374151}.search-input::placeholder{color:#9ca3af}.search-input:focus{outline:none}.clear-button{background:none;border:none;color:#6b7280;cursor:pointer;padding:.25rem;border-radius:4px;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.clear-button:hover{background-color:#f3f4f6;color:#374151}.clear-button:focus{outline:none;box-shadow:0 0 0 2px #3b82f633}.clear-button i{font-size:.875rem}@media (max-width: 768px){.search-container{padding:.75rem}.search-input-wrapper{padding:.5rem .75rem}.search-input{font-size:.8rem}}\n"] }]
|
|
2147
|
+
}], ctorParameters: () => [{ type: DocumentHelperService }], propDecorators: { contextId: [{
|
|
2148
|
+
type: Input
|
|
2149
|
+
}] } });
|
|
2150
|
+
|
|
1937
2151
|
/**
|
|
1938
2152
|
* The `FolderContainerComponent` is responsible for rendering a container
|
|
1939
2153
|
* that displays a list of documents and associated folder panel data.
|
|
@@ -1990,7 +2204,7 @@ class FolderContainerComponent {
|
|
|
1990
2204
|
});
|
|
1991
2205
|
}
|
|
1992
2206
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderContainerComponent, deps: [{ token: DocumentQuery }], target: i0.ɵɵFactoryTarget.Component });
|
|
1993
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId", userList: "userList", statusData: "statusData", categories: "categories" }, ngImport: i0, template: "\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\r\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\r\n</div>\r\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: UserListComponent, selector: "lib-user-list", inputs: ["userList", "categories"], outputs: ["userSelected"] }, { kind: "component", type: DocumentStatusComponent, selector: "lib-document-status", inputs: ["contextId", "statusData"] }], animations: [
|
|
2207
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId", userList: "userList", statusData: "statusData", categories: "categories" }, ngImport: i0, template: "\r\n<document-search [contextId]=\"contextId\"></document-search>\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\r\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\r\n</div>\r\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: UserListComponent, selector: "lib-user-list", inputs: ["userList", "categories"], outputs: ["userSelected"] }, { kind: "component", type: DocumentStatusComponent, selector: "lib-document-status", inputs: ["contextId", "statusData"] }, { kind: "component", type: DocumentSearchComponent, selector: "document-search", inputs: ["contextId"] }], animations: [
|
|
1994
2208
|
trigger('slideInOut', [
|
|
1995
2209
|
state('visible', style({
|
|
1996
2210
|
height: '*',
|
|
@@ -2044,7 +2258,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2044
2258
|
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)')
|
|
2045
2259
|
])
|
|
2046
2260
|
])
|
|
2047
|
-
], template: "\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\r\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\r\n</div>\r\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"] }]
|
|
2261
|
+
], template: "\r\n<document-search [contextId]=\"contextId\"></document-search>\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\r\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\r\n</div>\r\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"] }]
|
|
2048
2262
|
}], ctorParameters: () => [{ type: DocumentQuery }], propDecorators: { documentList: [{
|
|
2049
2263
|
type: Input
|
|
2050
2264
|
}], folderList: [{
|
|
@@ -2225,7 +2439,7 @@ class DocumentUploadService {
|
|
|
2225
2439
|
return null;
|
|
2226
2440
|
}
|
|
2227
2441
|
}
|
|
2228
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadService, deps: [{ token: DocumentService }, { token: DocumentStore }, { token: i3.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2442
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadService, deps: [{ token: DocumentService }, { token: DocumentStore }, { token: i3$1.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2229
2443
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadService, providedIn: 'root' });
|
|
2230
2444
|
}
|
|
2231
2445
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadService, decorators: [{
|
|
@@ -2233,7 +2447,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2233
2447
|
args: [{
|
|
2234
2448
|
providedIn: 'root'
|
|
2235
2449
|
}]
|
|
2236
|
-
}], ctorParameters: () => [{ type: DocumentService }, { type: DocumentStore }, { type: i3.MessageService }] });
|
|
2450
|
+
}], ctorParameters: () => [{ type: DocumentService }, { type: DocumentStore }, { type: i3$1.MessageService }] });
|
|
2237
2451
|
|
|
2238
2452
|
class DocumentTableBuilderService {
|
|
2239
2453
|
constructor() { }
|
|
@@ -2290,7 +2504,8 @@ class DocumentTableBuilderService {
|
|
|
2290
2504
|
status: doc.status || SHARED.PENDING,
|
|
2291
2505
|
uploadedOn: doc.uploadedOn || doc.uploadDate || SHARED.EMPTY,
|
|
2292
2506
|
ownerName: doc.ownerName || doc.applicantName || SHARED.EMPTY,
|
|
2293
|
-
contentType: doc.contentType || SHARED.EMPTY
|
|
2507
|
+
contentType: doc.contentType || SHARED.EMPTY,
|
|
2508
|
+
isUploaded: doc.isUploaded || false
|
|
2294
2509
|
}));
|
|
2295
2510
|
}
|
|
2296
2511
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentTableBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2303,11 +2518,157 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2303
2518
|
}]
|
|
2304
2519
|
}], ctorParameters: () => [] });
|
|
2305
2520
|
|
|
2521
|
+
/**
|
|
2522
|
+
* Service for managing user session details.
|
|
2523
|
+
* @class SessionService
|
|
2524
|
+
* @typedef {SessionService}
|
|
2525
|
+
*/
|
|
2526
|
+
class SessionService {
|
|
2527
|
+
router;
|
|
2528
|
+
/**
|
|
2529
|
+
* Creates an instance of SessionService.
|
|
2530
|
+
* @param {Router} router - Angular Router for navigation.
|
|
2531
|
+
*/
|
|
2532
|
+
constructor(router) {
|
|
2533
|
+
this.router = router;
|
|
2534
|
+
}
|
|
2535
|
+
/**
|
|
2536
|
+
* Retrieves the current user's role from local storage.
|
|
2537
|
+
* @returns {string | null} The user's role, or null if not found.
|
|
2538
|
+
*/
|
|
2539
|
+
getUserRole() {
|
|
2540
|
+
return localStorage.getItem('role');
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* Stores the user session data in local storage.
|
|
2544
|
+
* @param {any} data - The session data to store.
|
|
2545
|
+
*/
|
|
2546
|
+
setUserSession(data) {
|
|
2547
|
+
localStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
|
|
2548
|
+
}
|
|
2549
|
+
/**
|
|
2550
|
+
* Retrieves the stored user session data.
|
|
2551
|
+
* @returns {any | null} The parsed session data, or null if not found.
|
|
2552
|
+
*/
|
|
2553
|
+
getUserSession() {
|
|
2554
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
2555
|
+
return sessionData ? JSON.parse(sessionData) : null;
|
|
2556
|
+
}
|
|
2557
|
+
/**
|
|
2558
|
+
* Retrieves the user's permissions from the stored session data.
|
|
2559
|
+
* @returns {any | null} The user's permissions, or null if not found.
|
|
2560
|
+
*/
|
|
2561
|
+
getUserPermissions() {
|
|
2562
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
2563
|
+
return sessionData ? JSON.parse(sessionData).permissions : null;
|
|
2564
|
+
}
|
|
2565
|
+
/**
|
|
2566
|
+
* Retrieves the session ID from the stored session data.
|
|
2567
|
+
* @returns {any | null} The session ID, or null if not found.
|
|
2568
|
+
*/
|
|
2569
|
+
getSessionID() {
|
|
2570
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
2571
|
+
console.log(sessionData);
|
|
2572
|
+
if (sessionData) {
|
|
2573
|
+
const sessionId = JSON.parse(sessionData);
|
|
2574
|
+
console.log(sessionId);
|
|
2575
|
+
return sessionId;
|
|
2576
|
+
}
|
|
2577
|
+
return null;
|
|
2578
|
+
}
|
|
2579
|
+
/**
|
|
2580
|
+
* Clears all stored session data from local storage.
|
|
2581
|
+
*/
|
|
2582
|
+
clearSession() {
|
|
2583
|
+
localStorage.clear();
|
|
2584
|
+
}
|
|
2585
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2586
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
2587
|
+
}
|
|
2588
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, decorators: [{
|
|
2589
|
+
type: Injectable,
|
|
2590
|
+
args: [{
|
|
2591
|
+
providedIn: 'root'
|
|
2592
|
+
}]
|
|
2593
|
+
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
2594
|
+
|
|
2595
|
+
/**
|
|
2596
|
+
* Directive to conditionally show or hide elements based on user permissions.
|
|
2597
|
+
* @class HasPermissionDirective
|
|
2598
|
+
* @typedef {HasPermissionDirective}
|
|
2599
|
+
*/
|
|
2600
|
+
class HasPermissionDirective {
|
|
2601
|
+
el;
|
|
2602
|
+
renderer;
|
|
2603
|
+
sessionService;
|
|
2604
|
+
/**
|
|
2605
|
+
* The required permission(s) to display the element.
|
|
2606
|
+
* Accepts a single string or an array of strings.
|
|
2607
|
+
* @type {string | string[]}
|
|
2608
|
+
*/
|
|
2609
|
+
permission;
|
|
2610
|
+
/**
|
|
2611
|
+
* Creates an instance of HasPermissionDirective.
|
|
2612
|
+
* @param {ElementRef} el - Reference to the host element.
|
|
2613
|
+
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
2614
|
+
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
2615
|
+
*/
|
|
2616
|
+
constructor(el, renderer, sessionService) {
|
|
2617
|
+
this.el = el;
|
|
2618
|
+
this.renderer = renderer;
|
|
2619
|
+
this.sessionService = sessionService;
|
|
2620
|
+
}
|
|
2621
|
+
/**
|
|
2622
|
+
* Lifecycle hook that is called when input properties change.
|
|
2623
|
+
* @param {SimpleChanges} changes - The changes in input properties.
|
|
2624
|
+
*/
|
|
2625
|
+
ngOnChanges(changes) {
|
|
2626
|
+
if (changes['permission']) {
|
|
2627
|
+
this.checkPermission();
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
/**
|
|
2631
|
+
* Checks if the user has the required permission(s).
|
|
2632
|
+
* Hides the element if the permission is not found.
|
|
2633
|
+
*/
|
|
2634
|
+
checkPermission() {
|
|
2635
|
+
// If no permission is required (empty string, null, or undefined), show the element
|
|
2636
|
+
if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
|
|
2637
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
2638
|
+
return;
|
|
2639
|
+
}
|
|
2640
|
+
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
2641
|
+
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
2642
|
+
const requiredPermissions = Array.isArray(this.permission)
|
|
2643
|
+
? this.permission
|
|
2644
|
+
: [this.permission];
|
|
2645
|
+
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
2646
|
+
if (!hasPermission) {
|
|
2647
|
+
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
2648
|
+
}
|
|
2649
|
+
else {
|
|
2650
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2654
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
2655
|
+
}
|
|
2656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
2657
|
+
type: Directive,
|
|
2658
|
+
args: [{
|
|
2659
|
+
selector: '[permission]',
|
|
2660
|
+
standalone: false
|
|
2661
|
+
}]
|
|
2662
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
2663
|
+
type: Input
|
|
2664
|
+
}] } });
|
|
2665
|
+
|
|
2306
2666
|
class TablePrimaryComponent {
|
|
2307
2667
|
tableData = { columns: [], data: [] };
|
|
2308
2668
|
showHeader = true;
|
|
2309
2669
|
tableStyle = { 'min-width': '100%' };
|
|
2310
2670
|
rowClick = new EventEmitter();
|
|
2671
|
+
deleteAction = new EventEmitter();
|
|
2311
2672
|
processedData = [];
|
|
2312
2673
|
// Expose SHARED constants for template use
|
|
2313
2674
|
SHARED = SHARED;
|
|
@@ -2377,16 +2738,17 @@ class TablePrimaryComponent {
|
|
|
2377
2738
|
}
|
|
2378
2739
|
onActionClick(event, rowData) {
|
|
2379
2740
|
event.stopPropagation();
|
|
2741
|
+
this.deleteAction.emit(rowData);
|
|
2380
2742
|
}
|
|
2381
2743
|
onRowClick(rowData) {
|
|
2382
2744
|
this.rowClick.emit(rowData);
|
|
2383
2745
|
}
|
|
2384
2746
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePrimaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2385
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2747
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TablePrimaryComponent, isStandalone: false, selector: "lib-table-primary", inputs: { tableData: "tableData", showHeader: "showHeader", tableStyle: "tableStyle" }, outputs: { rowClick: "rowClick", deleteAction: "deleteAction" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"card\">\n <p-table [value]=\"processedData\" [tableStyle]=\"tableStyle\">\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\n <tr>\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\" [permission]=\"col.header === 'Actions' ? 'Documents-DELETE' : ''\">\n {{ col.header }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData>\n <tr (click)=\"onRowClick(rowData)\" class=\"clickable-row\">\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\n <!-- Document Cell -->\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_DOCUMENT\" class=\"document-cell\">\n <div class=\"document-info\">\n <div class=\"document-icon\">\n <i [class]=\"SHARED.ICON_FILE_PDF\" *ngIf=\"rowData._isPdfFile\"></i>\n <i [class]=\"SHARED.ICON_IMAGE\" *ngIf=\"rowData._isImageFile\"></i>\n <i [class]=\"SHARED.ICON_FILE_EXCEL\" *ngIf=\"rowData._isExcelFile\"></i>\n <i [class]=\"SHARED.ICON_FILE\" *ngIf=\"rowData._isOtherFile\"></i>\n </div>\n <div class=\"document-details\">\n <div class=\"document-name\">{{ rowData.docName }}</div>\n <div class=\"file-info\">{{ rowData.fileName }} - {{ rowData.fileSize }}</div>\n </div>\n </div>\n </div>\n\n <!-- Status Cell -->\n \n <div *ngIf=\"col.type === SHARED.CELL_TYPE_STATUS\" class=\"status-cell\">\n <span class=\"status-pill\" [ngClass]=\"rowData._statusClass\">\n <i [class]=\"rowData._statusIcon\"></i>\n {{ rowData[col.field] }}\n </span>\n </div>\n\n <!-- Actions Cell -->\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_ACTIONS\" class=\"actions-cell\">\n @if(rowData.isUploaded){\n\n <button [permission]=\"'Documents-DELETE'\" pButton pRipple type=\"button\" [icon]=\"SHARED.ICON_DELETE\" \n class=\"p-button-text p-button-rounded\" \n (click)=\"onActionClick($event, rowData)\">\n </button>\n } \n </div>\n\n <!-- Default Text Cell -->\n <div *ngIf=\"!col.type || col.type === SHARED.CELL_TYPE_TEXT\" class=\"text-cell\">\n {{ rowData[col.field] }}\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>", styles: [".document-cell .document-info{display:flex;align-items:center;gap:.75rem;text-align:left}.document-cell .document-info .document-icon{width:40px;height:40px;background-color:#e3f2fd;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#1976d2;font-size:1.25rem;flex-shrink:0}.document-cell .document-info .document-details{flex:1;min-width:0}.document-cell .document-info .document-details .document-name{font-weight:400;color:#334155;line-height:20px;font-size:14px;margin-bottom:.25rem;text-align:left}.document-cell .document-info .document-details .file-info{font-size:.75rem;color:#6c757d;text-align:left}.status-cell .status-pill{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .75rem;border-radius:20px;font-size:.75rem;font-weight:500;white-space:nowrap;min-width:80px}.status-cell .status-pill i{font-size:.875rem}.status-cell .status-pill.status-pending{background-color:#f3f4f6;color:#6b7280}.status-cell .status-pill.status-approved{background-color:#d1fae5;color:#065f46}.status-cell .status-pill.status-alert{background-color:#fee2e2;color:#dc2626}.status-cell .status-pill.status-uploaded{background-color:#dbeafe;color:#1d4ed8}.status-cell .status-pill.status-reviewing{background-color:#fef3c7;color:#d97706}.status-cell .status-pill.status-rejected{background-color:#fee2e2;color:#dc2626}.actions-cell{text-align:left}.actions-cell .p-button{width:2rem;height:2rem;border-radius:50%;background-color:transparent;border:none;color:#6c757d}.actions-cell .p-button:hover{background-color:#f8f9fa;color:#495057}.text-cell{font-weight:500;color:#475569;font-size:14px;line-height:20px;text-align:left}.clickable-row{cursor:pointer;transition:background-color .2s ease}.clickable-row:hover{background-color:#f8f9fa!important}.clickable-row:active{background-color:#e9ecef!important}::ng-deep .p-datatable .p-datatable-wrapper{border:1px solid #E2E8F0;border-radius:10px}::ng-deep .p-datatable .p-datatable-thead>tr>th{background-color:#f8f9fa;border:none;border-bottom:1px solid #dee2e6;padding:1rem 1.5rem;font-weight:600;color:#64748b;font-size:.875rem;text-transform:capitalize;letter-spacing:.5px;text-align:left;border-radius:8px 8px 0 0}::ng-deep .p-datatable .p-datatable-thead>tr>th:first-child{border-top-left-radius:8px}::ng-deep .p-datatable .p-datatable-thead>tr>th:last-child{border-top-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr{border-bottom:1px solid #f1f3f4}::ng-deep .p-datatable .p-datatable-tbody>tr:hover{background-color:#f8f9fa}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr>td{border:none;padding:1rem 1.5rem;vertical-align:middle;text-align:left}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i5.Ripple, selector: "[pRipple]" }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }] });
|
|
2386
2748
|
}
|
|
2387
2749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePrimaryComponent, decorators: [{
|
|
2388
2750
|
type: Component,
|
|
2389
|
-
args: [{ selector: 'lib-table-primary', standalone: false, template: "<div class=\"card\">\
|
|
2751
|
+
args: [{ selector: 'lib-table-primary', standalone: false, template: "<div class=\"card\">\n <p-table [value]=\"processedData\" [tableStyle]=\"tableStyle\">\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\n <tr>\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\" [permission]=\"col.header === 'Actions' ? 'Documents-DELETE' : ''\">\n {{ col.header }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData>\n <tr (click)=\"onRowClick(rowData)\" class=\"clickable-row\">\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\n <!-- Document Cell -->\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_DOCUMENT\" class=\"document-cell\">\n <div class=\"document-info\">\n <div class=\"document-icon\">\n <i [class]=\"SHARED.ICON_FILE_PDF\" *ngIf=\"rowData._isPdfFile\"></i>\n <i [class]=\"SHARED.ICON_IMAGE\" *ngIf=\"rowData._isImageFile\"></i>\n <i [class]=\"SHARED.ICON_FILE_EXCEL\" *ngIf=\"rowData._isExcelFile\"></i>\n <i [class]=\"SHARED.ICON_FILE\" *ngIf=\"rowData._isOtherFile\"></i>\n </div>\n <div class=\"document-details\">\n <div class=\"document-name\">{{ rowData.docName }}</div>\n <div class=\"file-info\">{{ rowData.fileName }} - {{ rowData.fileSize }}</div>\n </div>\n </div>\n </div>\n\n <!-- Status Cell -->\n \n <div *ngIf=\"col.type === SHARED.CELL_TYPE_STATUS\" class=\"status-cell\">\n <span class=\"status-pill\" [ngClass]=\"rowData._statusClass\">\n <i [class]=\"rowData._statusIcon\"></i>\n {{ rowData[col.field] }}\n </span>\n </div>\n\n <!-- Actions Cell -->\n <div *ngIf=\"col.type === SHARED.CELL_TYPE_ACTIONS\" class=\"actions-cell\">\n @if(rowData.isUploaded){\n\n <button [permission]=\"'Documents-DELETE'\" pButton pRipple type=\"button\" [icon]=\"SHARED.ICON_DELETE\" \n class=\"p-button-text p-button-rounded\" \n (click)=\"onActionClick($event, rowData)\">\n </button>\n } \n </div>\n\n <!-- Default Text Cell -->\n <div *ngIf=\"!col.type || col.type === SHARED.CELL_TYPE_TEXT\" class=\"text-cell\">\n {{ rowData[col.field] }}\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>", styles: [".document-cell .document-info{display:flex;align-items:center;gap:.75rem;text-align:left}.document-cell .document-info .document-icon{width:40px;height:40px;background-color:#e3f2fd;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#1976d2;font-size:1.25rem;flex-shrink:0}.document-cell .document-info .document-details{flex:1;min-width:0}.document-cell .document-info .document-details .document-name{font-weight:400;color:#334155;line-height:20px;font-size:14px;margin-bottom:.25rem;text-align:left}.document-cell .document-info .document-details .file-info{font-size:.75rem;color:#6c757d;text-align:left}.status-cell .status-pill{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .75rem;border-radius:20px;font-size:.75rem;font-weight:500;white-space:nowrap;min-width:80px}.status-cell .status-pill i{font-size:.875rem}.status-cell .status-pill.status-pending{background-color:#f3f4f6;color:#6b7280}.status-cell .status-pill.status-approved{background-color:#d1fae5;color:#065f46}.status-cell .status-pill.status-alert{background-color:#fee2e2;color:#dc2626}.status-cell .status-pill.status-uploaded{background-color:#dbeafe;color:#1d4ed8}.status-cell .status-pill.status-reviewing{background-color:#fef3c7;color:#d97706}.status-cell .status-pill.status-rejected{background-color:#fee2e2;color:#dc2626}.actions-cell{text-align:left}.actions-cell .p-button{width:2rem;height:2rem;border-radius:50%;background-color:transparent;border:none;color:#6c757d}.actions-cell .p-button:hover{background-color:#f8f9fa;color:#495057}.text-cell{font-weight:500;color:#475569;font-size:14px;line-height:20px;text-align:left}.clickable-row{cursor:pointer;transition:background-color .2s ease}.clickable-row:hover{background-color:#f8f9fa!important}.clickable-row:active{background-color:#e9ecef!important}::ng-deep .p-datatable .p-datatable-wrapper{border:1px solid #E2E8F0;border-radius:10px}::ng-deep .p-datatable .p-datatable-thead>tr>th{background-color:#f8f9fa;border:none;border-bottom:1px solid #dee2e6;padding:1rem 1.5rem;font-weight:600;color:#64748b;font-size:.875rem;text-transform:capitalize;letter-spacing:.5px;text-align:left;border-radius:8px 8px 0 0}::ng-deep .p-datatable .p-datatable-thead>tr>th:first-child{border-top-left-radius:8px}::ng-deep .p-datatable .p-datatable-thead>tr>th:last-child{border-top-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr{border-bottom:1px solid #f1f3f4}::ng-deep .p-datatable .p-datatable-tbody>tr:hover{background-color:#f8f9fa}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr>td{border:none;padding:1rem 1.5rem;vertical-align:middle;text-align:left}\n"] }]
|
|
2390
2752
|
}], propDecorators: { tableData: [{
|
|
2391
2753
|
type: Input
|
|
2392
2754
|
}], showHeader: [{
|
|
@@ -2395,6 +2757,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2395
2757
|
type: Input
|
|
2396
2758
|
}], rowClick: [{
|
|
2397
2759
|
type: Output
|
|
2760
|
+
}], deleteAction: [{
|
|
2761
|
+
type: Output
|
|
2398
2762
|
}] } });
|
|
2399
2763
|
|
|
2400
2764
|
/**
|
|
@@ -2579,13 +2943,13 @@ class DocumentUploadComponent {
|
|
|
2579
2943
|
triggerFileUpload() {
|
|
2580
2944
|
this.fileUploader.choose();
|
|
2581
2945
|
}
|
|
2582
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentUploadService }, { token: DocumentService }, { token: i3.PrimeNGConfig }, { token: FileFormatService }, { token: i3.MessageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2583
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"26214400\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}.docHeader .p-button-icon{padding:.5rem}\n"], dependencies: [{ kind: "directive", type:
|
|
2946
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentUploadService }, { token: DocumentService }, { token: i3$1.PrimeNGConfig }, { token: FileFormatService }, { token: i3$1.MessageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2947
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"26214400\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}.docHeader .p-button-icon{padding:.5rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i4.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: i7.FileUpload, selector: "p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "component", type: i8.ProgressBar, selector: "p-progressBar", inputs: ["value", "showValue", "styleClass", "style", "unit", "mode", "color"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
2584
2948
|
}
|
|
2585
2949
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadComponent, decorators: [{
|
|
2586
2950
|
type: Component,
|
|
2587
2951
|
args: [{ selector: 'lib-document-upload', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"26214400\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}.docHeader .p-button-icon{padding:.5rem}\n"] }]
|
|
2588
|
-
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentService }, { type: i3.PrimeNGConfig }, { type: FileFormatService }, { type: i3.MessageService }, { type: i0.ChangeDetectorRef }], propDecorators: { contextId: [{
|
|
2952
|
+
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentService }, { type: i3$1.PrimeNGConfig }, { type: FileFormatService }, { type: i3$1.MessageService }, { type: i0.ChangeDetectorRef }], propDecorators: { contextId: [{
|
|
2589
2953
|
type: Input
|
|
2590
2954
|
}], fileUploader: [{
|
|
2591
2955
|
type: ViewChild,
|
|
@@ -2894,7 +3258,7 @@ class DocumentHistoryComponent {
|
|
|
2894
3258
|
document.body.removeChild(link);
|
|
2895
3259
|
}
|
|
2896
3260
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, deps: [{ token: DocumentHistoryStyleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2897
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory" }, ngImport: i0, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request'\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <button class=\"action-btn download-btn\" \r\n title=\"Download\"\r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\">\r\n <i class=\"pi pi-download\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".document-history-container{padding:1rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:70vh;overflow-y:auto}.document-history-container .history-header{margin-bottom:1.5rem}.document-history-container .history-header .history-title{font-size:1.5rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:2rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border:1px solid;border-radius:8px;padding:1rem 1.5rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:1rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:1rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:1rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable{cursor:pointer;text-decoration:underline}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i3$1.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }] });
|
|
3261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory" }, ngImport: i0, template: "<div class=\"document-history-container\" *ngIf=\"showHistory && historyData.length > 0\">\r\n <div class=\"history-sections\">\r\n <div class=\"history-section\" *ngFor=\"let section of processedHistoryData\">\r\n <div *ngIf=\"section.header === 'Initial Request'\" \r\n class=\"initial-request-section\"\r\n [ngClass]=\"section.accordionClass\">\r\n <p-accordion [activeIndex]=\"activeAccordionIndex\" \r\n (onOpen)=\"onAccordionOpen()\" \r\n (onClose)=\"onAccordionClose()\">\r\n <p-accordionTab [header]=\"section.header\">\r\n <div class=\"history-timeline\" *ngIf=\"section.hasValidContent\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription ?? 'No Request' }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"document-actions\">\r\n <button class=\"action-btn download-btn\" \r\n title=\"Download\"\r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\">\r\n <i class=\"pi pi-download\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- Show message if no valid content -->\r\n <div class=\"no-content-message\" *ngIf=\"!section.hasValidContent\">\r\n <p>No initial request details available.</p>\r\n </div>\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n \r\n <!-- Document History as regular timeline -->\r\n <div *ngIf=\"section.header !== 'Initial Request'\" class=\"document-history-section\">\r\n <div class=\"section-header\" *ngIf=\"section.header\">\r\n <h4 class=\"section-title\">{{ section.header }}</h4>\r\n </div>\r\n \r\n <div class=\"history-timeline\">\r\n <div class=\"timeline-item\" *ngFor=\"let item of section.list; let i = index\">\r\n <div class=\"timeline-card\" [ngClass]=\"item.actionBgColor\">\r\n <!-- Header with icon and timestamp -->\r\n <div class=\"card-header\">\r\n <div class=\"action-info\">\r\n <div class=\"action-icon\" [ngClass]=\"item.actionIconBgColor\">\r\n <i [class]=\"item.actionIcon\"></i>\r\n </div>\r\n <span class=\"action-label\" [ngClass]=\"item.actionColor\">\r\n {{ item.label }}\r\n </span>\r\n </div>\r\n <div class=\"timestamp\">\r\n {{ item.dateTime }}\r\n </div>\r\n </div>\r\n \r\n <!-- Description -->\r\n <div class=\"card-description\" *ngIf=\"item.requestDescription\">\r\n <p class=\"description-text\">{{ item.requestDescription }}</p>\r\n </div>\r\n \r\n <!-- Document details if URL exists -->\r\n <div class=\"document-details\" *ngIf=\"item.documentUrl\">\r\n <div class=\"document-card\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file\"></i>\r\n </div>\r\n <div class=\"document-text\">\r\n <div class=\"document-title\">Document</div>\r\n <div class=\"document-filename clickable\" \r\n (click)=\"downloadDocument(item.documentUrl!, item.docName)\"\r\n title=\"Click to download\">\r\n {{ item.docName || 'Document' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- User information -->\r\n <div class=\"user-info\">\r\n <span class=\"user-name\">{{ item.userName }}</span>\r\n <span class=\"user-role\">({{ item.userRole }})</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>", styles: [".document-history-container{padding:1rem;background:#fff;border-radius:8px;box-shadow:0 2px 4px #0000001a;max-height:70vh;overflow-y:auto}.document-history-container .history-header{margin-bottom:1.5rem}.document-history-container .history-header .history-title{font-size:1.5rem;font-weight:600;color:#374151;margin:0}.document-history-container .history-sections .history-section{margin-bottom:2rem}.document-history-container .history-sections .history-section .initial-request-section{margin-bottom:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{background:#fff;border:1px solid;border-radius:8px;padding:1rem 1.5rem;font-weight:600;color:#1f2937;font-size:1rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link:focus{box-shadow:none}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link .p-accordion-header-icon{color:#6b7280;font-size:.875rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-header.p-highlight .p-accordion-header-link{background:#fff}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content{background:#fff;border:1px solid;border-top:none;border-radius:0 0 8px 8px;padding:1.5rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item{margin-bottom:0}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:1rem;border-right:3px solid}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{background:#7d879b;color:#fff;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{color:#1f2937;font-weight:600}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-header .timestamp{color:#6b7280;font-size:.75rem}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .card-description .description-text{color:#374151;line-height:1.5}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-name{color:#1f2937;font-weight:500}.document-history-container .history-sections .history-section .initial-request-section ::ng-deep .p-accordion .p-accordion-content .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-requested ::ng-deep .p-accordion .p-accordion-content{border-color:#d1d5db}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-uploaded ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-rejected ::ng-deep .p-accordion .p-accordion-content{border-color:#fca5a5}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-header .p-accordion-header-link{border-color:#86efac}.document-history-container .history-sections .history-section .initial-request-section.document-accepted ::ng-deep .p-accordion .p-accordion-content{border-color:#86efac}.document-history-container .history-sections .history-section .document-history-section .section-header{margin-bottom:1rem}.document-history-container .history-sections .history-section .document-history-section .section-header .section-title{font-size:1.25rem;font-weight:500;color:#374151;margin:0}.document-history-container .history-sections .history-section .history-timeline .timeline-item{margin-bottom:1rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card{border-radius:8px;border:1px solid;padding:1rem;position:relative;border-right:3px solid}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-green-50{background-color:#f0fdf4;border-color:#bbf7d0;border-right-color:#10b981}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-red-50{background-color:#fef2f2;border-color:#fecaca;border-right-color:#ef4444}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-blue-50{background-color:#eff6ff;border-color:#bfdbfe;border-right-color:#3b82f6}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card.bg-gray-50{background-color:#f8fafc;border-color:#e2e8f0;border-right-color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-icon i{font-size:14px}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .action-info .action-label{font-weight:600;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-header .timestamp{font-size:.75rem;color:#6b7280}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .card-description .description-text{margin:0;color:#374151;font-size:.875rem;line-height:1.4}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details{margin-bottom:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card{background:#fff;border-radius:6px;padding:.75rem;display:flex;justify-content:space-between;align-items:center;border:1px solid #e5e7eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info{display:flex;align-items:center;gap:.5rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-icon{color:#3b82f6;font-size:1.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-title{font-weight:500;color:#374151;font-size:.875rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename{color:#3b82f6;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable{cursor:pointer;text-decoration:underline}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-info .document-text .document-filename.clickable:hover{color:#2563eb;text-decoration:none}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions{display:flex;gap:.25rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn{width:24px;height:24px;border:none;border-radius:4px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:.75rem}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn{background:#3b82f6;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.edit-btn:hover{background:#2563eb}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn{background:#ef4444;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.delete-btn:hover{background:#dc2626}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn{background:#10b981;color:#fff}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .document-details .document-card .document-actions .action-btn.download-btn:hover{background:#059669}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info{text-align:right;font-size:.75rem;color:#374151}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-name{font-weight:500}.document-history-container .history-sections .history-section .history-timeline .timeline-item .timeline-card .user-info .user-role{color:#6b7280}.text-green-600{color:#059669}.text-red-600{color:#dc2626}.text-blue-600{color:#2563eb}.text-gray-600{color:#4b5563}.bg-green-50{background-color:#f0fdf4}.bg-red-50{background-color:#fef2f2}.bg-blue-50{background-color:#eff6ff}.bg-gray-50{background-color:#f8fafc}.border-green-200{border-color:#bbf7d0}.border-red-200{border-color:#fecaca}.border-blue-200{border-color:#bfdbfe}.border-gray-200{border-color:#e2e8f0}.icon-bg-green{background-color:#10b981}.icon-bg-red{background-color:#ef4444}.icon-bg-blue{background-color:#3b82f6}.icon-bg-gray{background-color:#6b7280}.no-content-message{text-align:center;padding:2rem;color:#6b7280;font-style:italic}.no-content-message p{margin:0;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.Accordion, selector: "p-accordion", inputs: ["multiple", "style", "styleClass", "expandIcon", "collapseIcon", "activeIndex", "selectOnFocus", "headerAriaLevel"], outputs: ["onClose", "onOpen", "activeIndexChange"] }, { kind: "component", type: i3$2.AccordionTab, selector: "p-accordionTab", inputs: ["id", "header", "headerStyle", "tabStyle", "contentStyle", "tabStyleClass", "headerStyleClass", "contentStyleClass", "disabled", "cache", "transitionOptions", "iconPos", "selected", "headerAriaLevel"], outputs: ["selectedChange"] }] });
|
|
2898
3262
|
}
|
|
2899
3263
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, decorators: [{
|
|
2900
3264
|
type: Component,
|
|
@@ -2905,6 +3269,184 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2905
3269
|
type: Input
|
|
2906
3270
|
}] } });
|
|
2907
3271
|
|
|
3272
|
+
class DocumentActionsService {
|
|
3273
|
+
/**
|
|
3274
|
+
* Calculates the card class based on status
|
|
3275
|
+
* @param currentStatus - The current status of the document
|
|
3276
|
+
* @param statusId - The status ID from API
|
|
3277
|
+
* @returns {string} The CSS class for the card
|
|
3278
|
+
*/
|
|
3279
|
+
calculateCardClass(currentStatus, statusId) {
|
|
3280
|
+
// Use statusId if available, otherwise fall back to currentStatus
|
|
3281
|
+
if (statusId) {
|
|
3282
|
+
return `status-${statusId}-card`;
|
|
3283
|
+
}
|
|
3284
|
+
switch (currentStatus) {
|
|
3285
|
+
case SHARED.STATUS_ACCEPTED:
|
|
3286
|
+
return SHARED.CARD_ACCEPTED;
|
|
3287
|
+
case SHARED.STATUS_REJECTED_LOWERCASE:
|
|
3288
|
+
return SHARED.CARD_REJECTED;
|
|
3289
|
+
default:
|
|
3290
|
+
return SHARED.CARD_PENDING;
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
/**
|
|
3294
|
+
* Calculates the reject button class based on status
|
|
3295
|
+
* @param currentStatus - The current status of the document
|
|
3296
|
+
* @param statusId - The status ID from API
|
|
3297
|
+
* @returns {string} The CSS class for the reject button
|
|
3298
|
+
*/
|
|
3299
|
+
calculateRejectButtonClass(currentStatus, statusId) {
|
|
3300
|
+
// Use statusId if available, otherwise fall back to currentStatus
|
|
3301
|
+
if (statusId) {
|
|
3302
|
+
return `status-${statusId}-reject`;
|
|
3303
|
+
}
|
|
3304
|
+
switch (currentStatus) {
|
|
3305
|
+
case SHARED.STATUS_ACCEPTED:
|
|
3306
|
+
return SHARED.BUTTON_SECONDARY_REJECT;
|
|
3307
|
+
case SHARED.STATUS_REJECTED_LOWERCASE:
|
|
3308
|
+
return SHARED.BUTTON_PRIMARY_REJECT;
|
|
3309
|
+
default:
|
|
3310
|
+
return SHARED.BUTTON_DEFAULT_REJECT;
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3313
|
+
/**
|
|
3314
|
+
* Calculates the accept button class based on status
|
|
3315
|
+
* @param currentStatus - The current status of the document
|
|
3316
|
+
* @param statusId - The status ID from API
|
|
3317
|
+
* @returns {string} The CSS class for the accept button
|
|
3318
|
+
*/
|
|
3319
|
+
calculateAcceptButtonClass(currentStatus, statusId) {
|
|
3320
|
+
// Use statusId if available, otherwise fall back to currentStatus
|
|
3321
|
+
if (statusId) {
|
|
3322
|
+
return `status-${statusId}-accept`;
|
|
3323
|
+
}
|
|
3324
|
+
switch (currentStatus) {
|
|
3325
|
+
case SHARED.STATUS_ACCEPTED:
|
|
3326
|
+
return SHARED.BUTTON_PRIMARY_ACCEPT;
|
|
3327
|
+
case SHARED.STATUS_REJECTED_LOWERCASE:
|
|
3328
|
+
return SHARED.BUTTON_SECONDARY_ACCEPT;
|
|
3329
|
+
default:
|
|
3330
|
+
return SHARED.BUTTON_DEFAULT_ACCEPT;
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
/**
|
|
3334
|
+
* Creates an accept action
|
|
3335
|
+
* @param note - The acceptance note
|
|
3336
|
+
* @returns {DocumentAction} The accept action
|
|
3337
|
+
*/
|
|
3338
|
+
createAcceptAction(note) {
|
|
3339
|
+
return {
|
|
3340
|
+
type: SHARED.ACCEPT_ACTION,
|
|
3341
|
+
note: note
|
|
3342
|
+
};
|
|
3343
|
+
}
|
|
3344
|
+
/**
|
|
3345
|
+
* Creates a reject action
|
|
3346
|
+
* @param note - The rejection note
|
|
3347
|
+
* @returns {DocumentAction} The reject action
|
|
3348
|
+
*/
|
|
3349
|
+
createRejectAction(note) {
|
|
3350
|
+
return {
|
|
3351
|
+
type: SHARED.REJECT_ACTION,
|
|
3352
|
+
note: note
|
|
3353
|
+
};
|
|
3354
|
+
}
|
|
3355
|
+
/**
|
|
3356
|
+
* Creates a delete action
|
|
3357
|
+
* @returns {DocumentAction} The delete action
|
|
3358
|
+
*/
|
|
3359
|
+
createDeleteAction() {
|
|
3360
|
+
return {
|
|
3361
|
+
type: SHARED.DELETE_ACTION
|
|
3362
|
+
};
|
|
3363
|
+
}
|
|
3364
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3365
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsService, providedIn: 'root' });
|
|
3366
|
+
}
|
|
3367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsService, decorators: [{
|
|
3368
|
+
type: Injectable,
|
|
3369
|
+
args: [{
|
|
3370
|
+
providedIn: 'root'
|
|
3371
|
+
}]
|
|
3372
|
+
}] });
|
|
3373
|
+
|
|
3374
|
+
class DocumentActionsComponent {
|
|
3375
|
+
documentActionsService;
|
|
3376
|
+
SHARED = SHARED;
|
|
3377
|
+
documentId;
|
|
3378
|
+
currentStatus;
|
|
3379
|
+
isLoading = false;
|
|
3380
|
+
isUploaded = false;
|
|
3381
|
+
statusId;
|
|
3382
|
+
actionPerformed = new EventEmitter();
|
|
3383
|
+
showAcceptDialog = false;
|
|
3384
|
+
showRejectDialog = false;
|
|
3385
|
+
acceptNote = SHARED.EMPTY;
|
|
3386
|
+
rejectNote = SHARED.EMPTY;
|
|
3387
|
+
// Computed properties for template
|
|
3388
|
+
cardClass = SHARED.CARD_PENDING;
|
|
3389
|
+
rejectButtonClass = SHARED.BUTTON_DEFAULT_REJECT;
|
|
3390
|
+
acceptButtonClass = SHARED.BUTTON_DEFAULT_ACCEPT;
|
|
3391
|
+
constructor(documentActionsService) {
|
|
3392
|
+
this.documentActionsService = documentActionsService;
|
|
3393
|
+
}
|
|
3394
|
+
ngOnChanges(changes) {
|
|
3395
|
+
this.updateComputedProperties();
|
|
3396
|
+
}
|
|
3397
|
+
/**
|
|
3398
|
+
* Updates computed properties based on currentStatus and statusId
|
|
3399
|
+
*/
|
|
3400
|
+
updateComputedProperties() {
|
|
3401
|
+
this.cardClass = this.documentActionsService.calculateCardClass(this.currentStatus, this.statusId);
|
|
3402
|
+
this.rejectButtonClass = this.documentActionsService.calculateRejectButtonClass(this.currentStatus, this.statusId);
|
|
3403
|
+
this.acceptButtonClass = this.documentActionsService.calculateAcceptButtonClass(this.currentStatus, this.statusId);
|
|
3404
|
+
}
|
|
3405
|
+
onAcceptClick() {
|
|
3406
|
+
this.showAcceptDialog = true;
|
|
3407
|
+
}
|
|
3408
|
+
onRejectClick() {
|
|
3409
|
+
this.showRejectDialog = true;
|
|
3410
|
+
}
|
|
3411
|
+
onDeleteClick() {
|
|
3412
|
+
this.actionPerformed.emit(this.documentActionsService.createDeleteAction());
|
|
3413
|
+
}
|
|
3414
|
+
onAcceptConfirm() {
|
|
3415
|
+
this.actionPerformed.emit(this.documentActionsService.createAcceptAction(this.acceptNote));
|
|
3416
|
+
this.acceptNote = SHARED.EMPTY;
|
|
3417
|
+
this.showAcceptDialog = false;
|
|
3418
|
+
}
|
|
3419
|
+
onRejectConfirm() {
|
|
3420
|
+
this.actionPerformed.emit(this.documentActionsService.createRejectAction(this.rejectNote));
|
|
3421
|
+
this.rejectNote = SHARED.EMPTY;
|
|
3422
|
+
this.showRejectDialog = false;
|
|
3423
|
+
}
|
|
3424
|
+
onCancel() {
|
|
3425
|
+
this.showAcceptDialog = false;
|
|
3426
|
+
this.showRejectDialog = false;
|
|
3427
|
+
this.acceptNote = SHARED.EMPTY;
|
|
3428
|
+
this.rejectNote = SHARED.EMPTY;
|
|
3429
|
+
}
|
|
3430
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, deps: [{ token: DocumentActionsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3431
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentActionsComponent, isStandalone: false, selector: "document-actions", inputs: { documentId: "documentId", currentStatus: "currentStatus", isLoading: "isLoading", isUploaded: "isUploaded", statusId: "statusId" }, outputs: { actionPerformed: "actionPerformed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-actions-container\" *ngIf=\"isUploaded\">\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\n <div class=\"actions-buttons\">\n <!-- Reject Button -->\n <button \n class=\"action-btn reject-btn\" \n [ngClass]=\"rejectButtonClass\"\n (click)=\"onRejectClick()\"\n [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isLoading\">\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED : SHARED.BUTTON_LABEL_REJECT }}</span>\n </button>\n\n <!-- Accept Button -->\n <button \n class=\"action-btn accept-btn\" \n [ngClass]=\"acceptButtonClass\"\n (click)=\"onAcceptClick()\"\n [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isLoading\">\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isLoading\"></i>\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT }}</span>\n </button>\n\n <!-- Delete Button -->\n <button \n class=\"action-btn delete-btn\" \n (click)=\"onDeleteClick()\"\n [disabled]=\"isLoading\">\n <i class=\"pi pi-trash\"></i>\n </button>\n </div>\n </div>\n</div>\n\n<!-- Accept Confirmation Dialog -->\n<p-dialog \n [(visible)]=\"showAcceptDialog\" \n [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" \n [modal]=\"true\" \n [draggable]=\"false\" \n [closable]=\"true\"\n [style]=\"{ width: '25rem', height: '25rem' }\"\n styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\n <textarea \n id=\"acceptNote\"\n pInputTextarea \n [(ngModel)]=\"acceptNote\" \n [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\n rows=\"6\"\n class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button \n pButton \n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \n class=\"p-button-secondary\" \n (click)=\"onCancel()\">\n </button>\n <button \n pButton \n [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" \n class=\"p-button-success\" \n (click)=\"onAcceptConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>\n\n<!-- Reject Confirmation Dialog -->\n<p-dialog \n [(visible)]=\"showRejectDialog\" \n [header]=\"SHARED.REJECT_CONFIRM_HEADER\" \n [modal]=\"true\" \n [draggable]=\"false\" \n [closable]=\"true\"\n [style]=\"{ width: '25rem', height: '25rem' }\"\n styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\n <textarea \n id=\"rejectNote\"\n pInputTextarea \n [(ngModel)]=\"rejectNote\" \n [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\n rows=\"6\"\n class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button \n pButton \n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \n class=\"p-button-secondary\" \n (click)=\"onCancel()\">\n </button>\n <button \n pButton \n [label]=\"SHARED.REJECT_BUTTON_LABEL\" \n class=\"p-button-danger\" \n (click)=\"onRejectConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog> ", styles: [".document-actions-container{margin:1rem 0}.actions-card{border-radius:8px;padding:1rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#d4edda;border:1px solid #28a745}.actions-card.rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-approved-card{background-color:#d4edda;border:1px solid #28a745}.actions-card[class*=status-].status-rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn.primary-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn.primary-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-approved-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn[class*=status-].status-rejected-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-pending-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn.primary-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-approved-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-rejected-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn[class*=status-].status-pending-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#fff;border-color:#e2e8f0;color:#e53e3e;padding:.5rem;min-width:auto;width:40px;height:40px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "directive", type: i5$1.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { 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: "component", type: i7$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }] });
|
|
3432
|
+
}
|
|
3433
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentActionsComponent, decorators: [{
|
|
3434
|
+
type: Component,
|
|
3435
|
+
args: [{ selector: 'document-actions', standalone: false, template: "<div class=\"document-actions-container\" *ngIf=\"isUploaded\">\n <div class=\"actions-card\" [ngClass]=\"cardClass\">\n <div class=\"actions-buttons\">\n <!-- Reject Button -->\n <button \n class=\"action-btn reject-btn\" \n [ngClass]=\"rejectButtonClass\"\n (click)=\"onRejectClick()\"\n [disabled]=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE || isLoading\">\n <i class=\"pi pi-times\" *ngIf=\"currentStatus === SHARED.STATUS_REJECTED_LOWERCASE\"></i>\n <span>{{ currentStatus === SHARED.STATUS_REJECTED_LOWERCASE ? SHARED.BUTTON_LABEL_REJECTED : SHARED.BUTTON_LABEL_REJECT }}</span>\n </button>\n\n <!-- Accept Button -->\n <button \n class=\"action-btn accept-btn\" \n [ngClass]=\"acceptButtonClass\"\n (click)=\"onAcceptClick()\"\n [disabled]=\"currentStatus === SHARED.STATUS_ACCEPTED || isLoading\">\n <i class=\"pi pi-check\" *ngIf=\"currentStatus === SHARED.STATUS_ACCEPTED\"></i>\n <i class=\"pi pi-spin pi-spinner\" *ngIf=\"isLoading\"></i>\n <span>{{ currentStatus === SHARED.STATUS_ACCEPTED ? SHARED.BUTTON_LABEL_ACCEPTED : SHARED.BUTTON_LABEL_ACCEPT }}</span>\n </button>\n\n <!-- Delete Button -->\n <button \n class=\"action-btn delete-btn\" \n (click)=\"onDeleteClick()\"\n [disabled]=\"isLoading\">\n <i class=\"pi pi-trash\"></i>\n </button>\n </div>\n </div>\n</div>\n\n<!-- Accept Confirmation Dialog -->\n<p-dialog \n [(visible)]=\"showAcceptDialog\" \n [header]=\"SHARED.ACCEPT_CONFIRM_HEADER\" \n [modal]=\"true\" \n [draggable]=\"false\" \n [closable]=\"true\"\n [style]=\"{ width: '25rem', height: '25rem' }\"\n styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"acceptNote\" class=\"note-label\">{{ SHARED.ACCEPT_NOTE_LABEL }}</label>\n <textarea \n id=\"acceptNote\"\n pInputTextarea \n [(ngModel)]=\"acceptNote\" \n [placeholder]=\"SHARED.ACCEPT_NOTE_PLACEHOLDER\"\n rows=\"6\"\n class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button \n pButton \n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \n class=\"p-button-secondary\" \n (click)=\"onCancel()\">\n </button>\n <button \n pButton \n [label]=\"SHARED.ACCEPT_BUTTON_LABEL\" \n class=\"p-button-success\" \n (click)=\"onAcceptConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog>\n\n<!-- Reject Confirmation Dialog -->\n<p-dialog \n [(visible)]=\"showRejectDialog\" \n [header]=\"SHARED.REJECT_CONFIRM_HEADER\" \n [modal]=\"true\" \n [draggable]=\"false\" \n [closable]=\"true\"\n [style]=\"{ width: '25rem', height: '25rem' }\"\n styleClass=\"confirmation-dialog\">\n <div class=\"dialog-content\">\n <label for=\"rejectNote\" class=\"note-label\">{{ SHARED.REJECT_NOTE_LABEL }}</label>\n <textarea \n id=\"rejectNote\"\n pInputTextarea \n [(ngModel)]=\"rejectNote\" \n [placeholder]=\"SHARED.REJECT_NOTE_PLACEHOLDER\"\n rows=\"6\"\n class=\"note-textarea\">\n </textarea>\n </div>\n <ng-template pTemplate=\"footer\">\n <div class=\"dialog-footer\">\n <button \n pButton \n [label]=\"SHARED.CANCEL_BUTTON_LABEL\" \n class=\"p-button-secondary\" \n (click)=\"onCancel()\">\n </button>\n <button \n pButton \n [label]=\"SHARED.REJECT_BUTTON_LABEL\" \n class=\"p-button-danger\" \n (click)=\"onRejectConfirm()\">\n </button>\n </div>\n </ng-template>\n</p-dialog> ", styles: [".document-actions-container{margin:1rem 0}.actions-card{border-radius:8px;padding:1rem;box-shadow:0 2px 4px #0000001a;transition:all .3s ease}.actions-card.pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-card.accepted-card{background-color:#d4edda;border:1px solid #28a745}.actions-card.rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-approved-card{background-color:#d4edda;border:1px solid #28a745}.actions-card[class*=status-].status-rejected-card{background-color:#f8d7da;border:1px solid #dc3545}.actions-card[class*=status-].status-pending-card{background-color:#f8f9fa;border:1px solid #e9ecef}.actions-buttons{display:flex;gap:.5rem;align-items:center}.action-btn{padding:.5rem 1rem;border-radius:6px;border:1px solid;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:.5rem;min-width:80px;justify-content:center}.action-btn:disabled{opacity:.6;cursor:not-allowed}.action-btn i{font-size:.875rem}.reject-btn.default-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn.default-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.reject-btn.secondary-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn.secondary-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn.primary-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn.primary-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-approved-reject{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.reject-btn[class*=status-].status-approved-reject:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.reject-btn[class*=status-].status-rejected-reject{background-color:#dc3545;border-color:#dc3545;color:#fff}.reject-btn[class*=status-].status-rejected-reject:hover:not(:disabled){background-color:#c82333;border-color:#bd2130}.reject-btn[class*=status-].status-pending-reject{background-color:#fff5f5;border-color:#feb2b2;color:#4a5568}.reject-btn[class*=status-].status-pending-reject:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181}.accept-btn.default-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn.default-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.accept-btn.secondary-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn.secondary-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn.primary-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn.primary-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-approved-accept{background-color:#28a745;border-color:#28a745;color:#fff}.accept-btn[class*=status-].status-approved-accept:hover:not(:disabled){background-color:#218838;border-color:#1e7e34}.accept-btn[class*=status-].status-rejected-accept{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.accept-btn[class*=status-].status-rejected-accept:hover:not(:disabled){background-color:#edf2f7;border-color:#cbd5e0}.accept-btn[class*=status-].status-pending-accept{background-color:#f0fff4;border-color:#9ae6b4;color:#4a5568}.accept-btn[class*=status-].status-pending-accept:hover:not(:disabled){background-color:#c6f6d5;border-color:#68d391}.delete-btn{background-color:#fff;border-color:#e2e8f0;color:#e53e3e;padding:.5rem;min-width:auto;width:40px;height:40px}.delete-btn:hover:not(:disabled){background-color:#fed7d7;border-color:#fc8181;color:#c53030}.delete-btn i{font-size:1rem}:host ::ng-deep .confirmation-dialog .p-dialog{border-radius:8px;box-shadow:0 4px 12px #00000026;border:none;overflow:hidden}:host ::ng-deep .confirmation-dialog .p-dialog-header{padding:1.25rem 1.5rem;background-color:#fff;border-bottom:none;border-top-right-radius:10px;border-top-left-radius:10px}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-header-icon{display:none}:host ::ng-deep .confirmation-dialog .p-dialog-header .p-dialog-title{font-size:1.125rem;font-weight:600;color:#2d3748;margin:0}:host ::ng-deep .confirmation-dialog .p-dialog-content{padding:1.5rem;background-color:#fff}:host ::ng-deep .confirmation-dialog .p-dialog-footer{padding:1rem 1.5rem;background-color:#f7fafc;border-top:1px solid #e2e8f0;display:flex;gap:.75rem;justify-content:flex-end;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.dialog-content .note-label{display:block;margin-bottom:.75rem;font-weight:500;font-size:.875rem;color:#2d3748}.dialog-content .note-textarea{width:100%;min-height:100px;padding:.75rem;border:1px solid #e2e8f0;border-radius:6px;font-family:inherit;font-size:.875rem;line-height:1.5;resize:vertical;background-color:#fff;color:#2d3748}.dialog-content .note-textarea::placeholder{color:#a0aec0}.dialog-content .note-textarea:focus{outline:none;border-color:#3182ce;box-shadow:0 0 0 3px #3182ce1a}.dialog-footer{display:flex;gap:.75rem;justify-content:flex-end}.dialog-footer button{min-width:80px;padding:.5rem 1rem;border-radius:6px;font-weight:500;font-size:.875rem;border:1px solid;cursor:pointer;transition:all .2s ease}.dialog-footer button.p-button-secondary{background-color:#f7fafc;border-color:#e2e8f0;color:#4a5568}.dialog-footer button.p-button-secondary:hover{background-color:#edf2f7;border-color:#cbd5e0}.dialog-footer button.p-button-success{background-color:#38a169;border-color:#38a169;color:#fff}.dialog-footer button.p-button-success:hover{background-color:#2f855a;border-color:#2f855a}.dialog-footer button.p-button-danger{background-color:#e53e3e;border-color:#e53e3e;color:#fff}.dialog-footer button.p-button-danger:hover{background-color:#c53030;border-color:#c53030}\n"] }]
|
|
3436
|
+
}], ctorParameters: () => [{ type: DocumentActionsService }], propDecorators: { documentId: [{
|
|
3437
|
+
type: Input
|
|
3438
|
+
}], currentStatus: [{
|
|
3439
|
+
type: Input
|
|
3440
|
+
}], isLoading: [{
|
|
3441
|
+
type: Input
|
|
3442
|
+
}], isUploaded: [{
|
|
3443
|
+
type: Input
|
|
3444
|
+
}], statusId: [{
|
|
3445
|
+
type: Input
|
|
3446
|
+
}], actionPerformed: [{
|
|
3447
|
+
type: Output
|
|
3448
|
+
}] } });
|
|
3449
|
+
|
|
2908
3450
|
/**
|
|
2909
3451
|
* Component for viewing and managing document details.
|
|
2910
3452
|
* @class DocumentViewerComponent
|
|
@@ -2913,6 +3455,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
2913
3455
|
class DocumentViewerComponent {
|
|
2914
3456
|
documentHttpService;
|
|
2915
3457
|
documentService;
|
|
3458
|
+
messageService;
|
|
2916
3459
|
/**
|
|
2917
3460
|
* Get the selected document by user.
|
|
2918
3461
|
* @type {*}
|
|
@@ -2923,6 +3466,11 @@ class DocumentViewerComponent {
|
|
|
2923
3466
|
* @type {*}
|
|
2924
3467
|
*/
|
|
2925
3468
|
documentList; // <-- Made optional to prevent undefined issues
|
|
3469
|
+
/**
|
|
3470
|
+
* Event emitted when document status is updated to refresh the document list
|
|
3471
|
+
* @type {EventEmitter<void>}
|
|
3472
|
+
*/
|
|
3473
|
+
documentStatusUpdated = new EventEmitter();
|
|
2926
3474
|
/**
|
|
2927
3475
|
* Indicates whether a checkbox is selected.
|
|
2928
3476
|
* @type {boolean}
|
|
@@ -2953,6 +3501,26 @@ class DocumentViewerComponent {
|
|
|
2953
3501
|
* @type {boolean}
|
|
2954
3502
|
*/
|
|
2955
3503
|
showDocumentHistory = false;
|
|
3504
|
+
/**
|
|
3505
|
+
* Messages for user feedback
|
|
3506
|
+
* @type {any[]}
|
|
3507
|
+
*/
|
|
3508
|
+
messages = [];
|
|
3509
|
+
/**
|
|
3510
|
+
* Loading state for document actions
|
|
3511
|
+
* @type {boolean}
|
|
3512
|
+
*/
|
|
3513
|
+
isActionLoading = false;
|
|
3514
|
+
/**
|
|
3515
|
+
* Computed document status for the actions component
|
|
3516
|
+
* @type {'pending' | 'accepted' | 'rejected'}
|
|
3517
|
+
*/
|
|
3518
|
+
documentStatus = SHARED.STATUS_PENDING;
|
|
3519
|
+
/**
|
|
3520
|
+
* Computed flag indicating if document is uploaded
|
|
3521
|
+
* @type {boolean}
|
|
3522
|
+
*/
|
|
3523
|
+
documentIsUploaded = false;
|
|
2956
3524
|
/**
|
|
2957
3525
|
* Holds the subscription to manage observable cleanup.
|
|
2958
3526
|
* @private
|
|
@@ -2964,19 +3532,21 @@ class DocumentViewerComponent {
|
|
|
2964
3532
|
* @param {DocumentHttpService} documentHttpService - Handle the http service.
|
|
2965
3533
|
* @param {DocumentService} documentService - Handle the states.
|
|
2966
3534
|
*/
|
|
2967
|
-
constructor(documentHttpService, documentService) {
|
|
3535
|
+
constructor(documentHttpService, documentService, messageService) {
|
|
2968
3536
|
this.documentHttpService = documentHttpService;
|
|
2969
3537
|
this.documentService = documentService;
|
|
3538
|
+
this.messageService = messageService;
|
|
2970
3539
|
}
|
|
2971
3540
|
/**
|
|
2972
3541
|
* Fetches the alerts for the selected document.
|
|
2973
3542
|
* @returns {void}
|
|
2974
3543
|
*/
|
|
2975
|
-
ngOnChanges() {
|
|
2976
|
-
if (this.selectedDocument) {
|
|
3544
|
+
ngOnChanges(changes) {
|
|
3545
|
+
if (changes['selectedDocument'] && this.selectedDocument) {
|
|
2977
3546
|
this.documentService.set(this.selectedDocument);
|
|
2978
3547
|
this.alertData = DocumentAlertList.find((res) => res.status === this.selectedDocument?.status);
|
|
2979
3548
|
this.loadDocumentHistory(this.selectedDocument._id);
|
|
3549
|
+
this.updateComputedProperties();
|
|
2980
3550
|
}
|
|
2981
3551
|
}
|
|
2982
3552
|
handleSelectedDocument(document) {
|
|
@@ -3013,16 +3583,141 @@ class DocumentViewerComponent {
|
|
|
3013
3583
|
ngOnDestroy() {
|
|
3014
3584
|
this.subscription.unsubscribe();
|
|
3015
3585
|
}
|
|
3016
|
-
|
|
3017
|
-
|
|
3586
|
+
/**
|
|
3587
|
+
* Updates computed properties based on selectedDocument
|
|
3588
|
+
*/
|
|
3589
|
+
updateComputedProperties() {
|
|
3590
|
+
this.documentStatus = this.calculateDocumentStatus();
|
|
3591
|
+
this.documentIsUploaded = this.calculateIsDocumentUploaded();
|
|
3592
|
+
}
|
|
3593
|
+
/**
|
|
3594
|
+
* Calculates the current status of the document for the actions component
|
|
3595
|
+
* @returns {'pending' | 'accepted' | 'rejected'} The current document status
|
|
3596
|
+
*/
|
|
3597
|
+
calculateDocumentStatus() {
|
|
3598
|
+
if (!this.selectedDocument)
|
|
3599
|
+
return SHARED.STATUS_PENDING;
|
|
3600
|
+
// First check statusId from API response if available
|
|
3601
|
+
if (this.selectedDocument.statusId) {
|
|
3602
|
+
switch (this.selectedDocument.statusId.toLowerCase()) {
|
|
3603
|
+
case SHARED.STATUS_APPROVED.toLowerCase():
|
|
3604
|
+
return SHARED.STATUS_ACCEPTED;
|
|
3605
|
+
case SHARED.STATUS_REJECTED.toLowerCase():
|
|
3606
|
+
return SHARED.STATUS_REJECTED_LOWERCASE;
|
|
3607
|
+
case SHARED.STATUS_PENDING:
|
|
3608
|
+
return SHARED.STATUS_PENDING;
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
// Fall back to status field mapping
|
|
3612
|
+
switch (this.selectedDocument.status?.toLowerCase()) {
|
|
3613
|
+
case SHARED.STATUS_APPROVED.toLowerCase():
|
|
3614
|
+
case SHARED.STATUS_ACCEPTED:
|
|
3615
|
+
return SHARED.STATUS_ACCEPTED;
|
|
3616
|
+
case SHARED.STATUS_REJECTED.toLowerCase():
|
|
3617
|
+
case SHARED.STATUS_DECLINED:
|
|
3618
|
+
return SHARED.STATUS_REJECTED_LOWERCASE;
|
|
3619
|
+
default:
|
|
3620
|
+
return SHARED.STATUS_PENDING;
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
/**
|
|
3624
|
+
* Calculates if the document is uploaded and ready for actions
|
|
3625
|
+
* @returns {boolean} True if document is uploaded
|
|
3626
|
+
*/
|
|
3627
|
+
calculateIsDocumentUploaded() {
|
|
3628
|
+
if (!this.selectedDocument)
|
|
3629
|
+
return false;
|
|
3630
|
+
// Check if document has a URL and is not in a pending state
|
|
3631
|
+
const isPending = this.selectedDocument.statusId?.toLowerCase() === SHARED.STATUS_PENDING ||
|
|
3632
|
+
this.selectedDocument.status?.toLowerCase() === SHARED.STATUS_PENDING;
|
|
3633
|
+
return !!(this.selectedDocument.documentUrl && !isPending);
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* Handles document actions from the actions component
|
|
3637
|
+
* @param {DocumentAction} action - The action performed
|
|
3638
|
+
*/
|
|
3639
|
+
handleDocumentAction(action) {
|
|
3640
|
+
console.log('Document action performed:', action);
|
|
3641
|
+
if (!this.selectedDocument?._id) {
|
|
3642
|
+
console.error('No document ID available');
|
|
3643
|
+
return;
|
|
3644
|
+
}
|
|
3645
|
+
switch (action.type) {
|
|
3646
|
+
case SHARED.ACCEPT_ACTION:
|
|
3647
|
+
this.updateDocumentStatus(SHARED.STATUS_APPROVED, action.note || SHARED.DOCUMENT_ACCEPTED_MESSAGE);
|
|
3648
|
+
break;
|
|
3649
|
+
case SHARED.REJECT_ACTION:
|
|
3650
|
+
this.updateDocumentStatus(SHARED.STATUS_REJECTED, action.note || SHARED.DOCUMENT_REJECTED_MESSAGE);
|
|
3651
|
+
break;
|
|
3652
|
+
case SHARED.DELETE_ACTION:
|
|
3653
|
+
console.log('Document delete requested');
|
|
3654
|
+
// TODO: Implement delete logic when API is available
|
|
3655
|
+
break;
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
/**
|
|
3659
|
+
* Updates the document status via API call
|
|
3660
|
+
* @param {string} status - The new status (Approved, Rejected)
|
|
3661
|
+
* @param {string} description - The status update description
|
|
3662
|
+
*/
|
|
3663
|
+
updateDocumentStatus(status, description) {
|
|
3664
|
+
if (!this.selectedDocument?._id) {
|
|
3665
|
+
console.error('No document ID available');
|
|
3666
|
+
return;
|
|
3667
|
+
}
|
|
3668
|
+
this.isActionLoading = true;
|
|
3669
|
+
this.documentHttpService.updateDocumentStatus(this.selectedDocument._id, status, description).subscribe({
|
|
3670
|
+
next: (response) => {
|
|
3671
|
+
console.log('Document status updated successfully:', response);
|
|
3672
|
+
// Update the local document status from response
|
|
3673
|
+
if (this.selectedDocument && response.status) {
|
|
3674
|
+
// Use the normalized status from the response if available
|
|
3675
|
+
const normalizedStatus = response.normalizedStatus || response.status.toLowerCase();
|
|
3676
|
+
this.selectedDocument.status = normalizedStatus;
|
|
3677
|
+
// Update computed properties after status change
|
|
3678
|
+
this.updateComputedProperties();
|
|
3679
|
+
}
|
|
3680
|
+
// Reload document history to show the new status
|
|
3681
|
+
if (this.selectedDocument?._id) {
|
|
3682
|
+
this.loadDocumentHistory(this.selectedDocument._id);
|
|
3683
|
+
}
|
|
3684
|
+
// Emit event to refresh document list
|
|
3685
|
+
this.documentStatusUpdated.emit();
|
|
3686
|
+
// Show success message
|
|
3687
|
+
this.messageService.add({
|
|
3688
|
+
severity: SHARED.SUCCESS_SEVERITY,
|
|
3689
|
+
summary: SHARED.SUCCESS,
|
|
3690
|
+
detail: status === SHARED.STATUS_APPROVED ?
|
|
3691
|
+
SHARED.DOCUMENT_ACCEPTED_MESSAGE :
|
|
3692
|
+
SHARED.DOCUMENT_REJECTED_MESSAGE
|
|
3693
|
+
});
|
|
3694
|
+
},
|
|
3695
|
+
error: (error) => {
|
|
3696
|
+
console.error('Error updating document status:', error);
|
|
3697
|
+
// Show error message to user
|
|
3698
|
+
this.messageService.add({
|
|
3699
|
+
severity: SHARED.SEVERITY,
|
|
3700
|
+
summary: SHARED.DANGER,
|
|
3701
|
+
detail: SHARED.DOCUMENT_UPDATE_ERROR_MESSAGE
|
|
3702
|
+
});
|
|
3703
|
+
},
|
|
3704
|
+
complete: () => {
|
|
3705
|
+
this.isActionLoading = false;
|
|
3706
|
+
}
|
|
3707
|
+
});
|
|
3708
|
+
}
|
|
3709
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentHelperService }, { token: i3$1.MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3710
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument", documentList: "documentList" }, outputs: { documentStatusUpdated: "documentStatusUpdated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <!-- Messages for user feedback -->\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\r\n \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-9\">\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 }@else{\r\n <div class=\"incorrect-docType\">\r\n ContentType is incorrect.\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 <!-- Document Actions Component -->\r\n @if(!selectedDocument?.isUploaded){\r\n <document-actions\r\n [documentId]=\"selectedDocument?._id\"\r\n [currentStatus]=\"documentStatus\"\r\n [isLoading]=\"isActionLoading\"\r\n [isUploaded]=\"documentIsUploaded\"\r\n [statusId]=\"selectedDocument?.statusId\"\r\n (actionPerformed)=\"handleDocumentAction($event)\">\r\n </document-actions>\r\n }\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 -->\r\n <document-history \r\n [historyData]=\"documentHistory\" \r\n [showHistory]=\"showDocumentHistory\">\r\n </document-history>\r\n \r\n <ng-content></ng-content>\r\n <!-- <app-linked-document (selectedDocumentChange)=\"handleSelectedDocument($event)\" [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\"></app-linked-document> -->\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: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: i6.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"] }, { kind: "component", type: DocumentHistoryComponent, selector: "document-history", inputs: ["historyData", "showHistory"] }, { kind: "component", type: DocumentActionsComponent, selector: "document-actions", inputs: ["documentId", "currentStatus", "isLoading", "isUploaded", "statusId"], outputs: ["actionPerformed"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3018
3711
|
}
|
|
3019
3712
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, decorators: [{
|
|
3020
3713
|
type: Component,
|
|
3021
|
-
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-9\">\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 }@else{\r\n <div class=\"incorrect-docType\">\r\n ContentType is incorrect.\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 -->\r\n <document-history \r\n [historyData]=\"documentHistory\" \r\n [showHistory]=\"showDocumentHistory\">\r\n </document-history>\r\n \r\n <ng-content></ng-content>\r\n <!-- <app-linked-document (selectedDocumentChange)=\"handleSelectedDocument($event)\" [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\"></app-linked-document> -->\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"] }]
|
|
3022
|
-
}], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentHelperService }], propDecorators: { selectedDocument: [{
|
|
3714
|
+
args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <!-- Messages for user feedback -->\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\r\n \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-9\">\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 }@else{\r\n <div class=\"incorrect-docType\">\r\n ContentType is incorrect.\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 <!-- Document Actions Component -->\r\n @if(!selectedDocument?.isUploaded){\r\n <document-actions\r\n [documentId]=\"selectedDocument?._id\"\r\n [currentStatus]=\"documentStatus\"\r\n [isLoading]=\"isActionLoading\"\r\n [isUploaded]=\"documentIsUploaded\"\r\n [statusId]=\"selectedDocument?.statusId\"\r\n (actionPerformed)=\"handleDocumentAction($event)\">\r\n </document-actions>\r\n }\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 -->\r\n <document-history \r\n [historyData]=\"documentHistory\" \r\n [showHistory]=\"showDocumentHistory\">\r\n </document-history>\r\n \r\n <ng-content></ng-content>\r\n <!-- <app-linked-document (selectedDocumentChange)=\"handleSelectedDocument($event)\" [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\"></app-linked-document> -->\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"] }]
|
|
3715
|
+
}], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentHelperService }, { type: i3$1.MessageService }], propDecorators: { selectedDocument: [{
|
|
3023
3716
|
type: Input
|
|
3024
3717
|
}], documentList: [{
|
|
3025
3718
|
type: Input
|
|
3719
|
+
}], documentStatusUpdated: [{
|
|
3720
|
+
type: Output
|
|
3026
3721
|
}] } });
|
|
3027
3722
|
|
|
3028
3723
|
/**
|
|
@@ -3036,6 +3731,7 @@ class DocumentListComponent {
|
|
|
3036
3731
|
documentQuery;
|
|
3037
3732
|
documentStore;
|
|
3038
3733
|
documentTableBuilder;
|
|
3734
|
+
documentHelperService;
|
|
3039
3735
|
/**
|
|
3040
3736
|
* Represents the context ID for the document list.
|
|
3041
3737
|
* This value is passed from the parent component.
|
|
@@ -3144,12 +3840,13 @@ class DocumentListComponent {
|
|
|
3144
3840
|
* @param {DocumentQuery} documentQuery - The service responsible for geting stored documents.
|
|
3145
3841
|
* @param {DocumentStore} documentStore - The service responsible for storing documents.
|
|
3146
3842
|
*/
|
|
3147
|
-
constructor(documentUploadService, documentHttpService, documentQuery, documentStore, documentTableBuilder) {
|
|
3843
|
+
constructor(documentUploadService, documentHttpService, documentQuery, documentStore, documentTableBuilder, documentHelperService) {
|
|
3148
3844
|
this.documentUploadService = documentUploadService;
|
|
3149
3845
|
this.documentHttpService = documentHttpService;
|
|
3150
3846
|
this.documentQuery = documentQuery;
|
|
3151
3847
|
this.documentStore = documentStore;
|
|
3152
3848
|
this.documentTableBuilder = documentTableBuilder;
|
|
3849
|
+
this.documentHelperService = documentHelperService;
|
|
3153
3850
|
}
|
|
3154
3851
|
/**
|
|
3155
3852
|
* Initializes the component by fetching the document type list.
|
|
@@ -3292,19 +3989,44 @@ class DocumentListComponent {
|
|
|
3292
3989
|
this.isdialogVisible = SHARED.TRUE;
|
|
3293
3990
|
this.selectedDocument = rowData;
|
|
3294
3991
|
}
|
|
3992
|
+
/**
|
|
3993
|
+
* Handles the delete action from the table component
|
|
3994
|
+
* @param {any} rowData - The row data containing the document to delete
|
|
3995
|
+
*/
|
|
3996
|
+
handleDeleteAction(rowData) {
|
|
3997
|
+
if (rowData._id && this.contextId) {
|
|
3998
|
+
this.documentHttpService.deleteDocument(rowData._id, this.contextId).subscribe({
|
|
3999
|
+
next: (response) => {
|
|
4000
|
+
console.log('Document deleted successfully:', response);
|
|
4001
|
+
// The document list will be automatically refreshed by the service
|
|
4002
|
+
},
|
|
4003
|
+
error: (error) => {
|
|
4004
|
+
console.error('Error deleting document:', error);
|
|
4005
|
+
}
|
|
4006
|
+
});
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
4009
|
+
/**
|
|
4010
|
+
* Refreshes the document list after a status update
|
|
4011
|
+
*/
|
|
4012
|
+
refreshDocumentList() {
|
|
4013
|
+
if (this.contextId) {
|
|
4014
|
+
this.documentHelperService.refreshDocumentsWithCurrentSelection(this.contextId);
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
3295
4017
|
/**
|
|
3296
4018
|
* Cleanup subscriptions on component destroy
|
|
3297
4019
|
*/
|
|
3298
4020
|
ngOnDestroy() {
|
|
3299
4021
|
this.documentListSubscription.unsubscribe();
|
|
3300
4022
|
}
|
|
3301
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }, { token: DocumentTableBuilderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3302
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", documentListResponse: "documentListResponse", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList", status: "status", category: "category", searchKey: "searchKey" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \r\n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\r\n [(ngModel)]=\"fileName\" />\r\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n\r\n<div class=\"document-categories-container\">\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ category.label }} Documents</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ categoryCompletionCounts[i] }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"categoryTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\">\r\n </lib-table-primary>\r\n </div>\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}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i8.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: i9.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: i10.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i11.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: i11.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i11.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i12.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: i13.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: i14.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["tableData", "showHeader", "tableStyle"], outputs: ["rowClick"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
4023
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }, { token: DocumentTableBuilderService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4024
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", documentListResponse: "documentListResponse", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList", status: "status", category: "category", searchKey: "searchKey" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \r\n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\" (documentStatusUpdated)=\"refreshDocumentList()\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\r\n [(ngModel)]=\"fileName\" />\r\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"document-categories-container\">\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ category.label }} Documents</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ categoryCompletionCounts[i] }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"categoryTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\"\r\n (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\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}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i4.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: i10.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: i5$2.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { 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: "component", type: i7$1.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: i14.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: i15.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["tableData", "showHeader", "tableStyle"], outputs: ["rowClick", "deleteAction"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList"], outputs: ["documentStatusUpdated"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3303
4025
|
}
|
|
3304
4026
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
3305
4027
|
type: Component,
|
|
3306
|
-
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \r\n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\r\n [(ngModel)]=\"fileName\" />\r\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n
|
|
3307
|
-
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }, { type: DocumentTableBuilderService }], propDecorators: { contextId: [{
|
|
4028
|
+
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \r\n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\r\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\" (documentStatusUpdated)=\"refreshDocumentList()\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"w-full flex align-items-center justify-content-between\">\r\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\r\n [(ngModel)]=\"fileName\" />\r\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\r\n </button>\r\n </div>\r\n </ng-template>\r\n <ng-content></ng-content>\r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"document-categories-container\">\r\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\r\n <div class=\"category-header\">\r\n <div class=\"category-title\">\r\n <h3>{{ category.label }} Documents</h3>\r\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ categoryCompletionCounts[i] }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"categoryTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\"\r\n (rowClick)=\"handleTableRowClick($event)\"\r\n (deleteAction)=\"handleDeleteAction($event)\">\r\n </lib-table-primary>\r\n </div>\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}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"] }]
|
|
4029
|
+
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }, { type: DocumentTableBuilderService }, { type: DocumentHelperService }], propDecorators: { contextId: [{
|
|
3308
4030
|
type: Input
|
|
3309
4031
|
}], documentListResponse: [{
|
|
3310
4032
|
type: Input
|
|
@@ -3561,7 +4283,7 @@ class DocumentsMenuComponent {
|
|
|
3561
4283
|
return this.selectedMenuItemId;
|
|
3562
4284
|
}
|
|
3563
4285
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentMenuService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3564
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { catagories: "catagories", applicationNumber: "applicationNumber", contextId: "contextId" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\r\n <p-card class=\"widget-menu-wrapper h-full\">\r\n @if(applicationNumber){\r\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\r\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\r\n <div class=\"expand-icon-wrapper\">\r\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"catagories\" styleClass=\"w-full md:w-15rem\">\r\n <ng-template pTemplate=\"submenuheader\" let-item>\r\n <span [style]=\"{\r\n color : '#9EA0B3'\r\n }\">{{ item.label }}</span>\r\n </ng-template>\r\n <ng-template pTemplate=\"item\" let-item>\r\n <a pRipple \r\n class=\"flex align-items-center p-menuitem-link\"\r\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\r\n (click)=\"onMenuItemClick($event, item)\">\r\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\r\n <span class=\"ml-2\">{{ item.label }}</span>\r\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \r\n class=\"ml-auto\" \r\n [severity]=\"item.menuData?.badgeSeverity\" \r\n [value]=\"item.menuData?.badgeValue\" />\r\n </a>\r\n </ng-template>\r\n </p-menu>\r\n </div>\r\n </div>\r\n </p-card>\r\n</div>\r\n\r\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-menu .p-menuitem>.p-menuitem-content .p-menuitem-link{color:#1f2937}@media screen and (min-width: 768px){::ng-deep .md\\:w-15rem{width:100%!important}}::ng-deep .p-menu .p-menuitem:not(p-highlight):not(p-disabled)>.p-menuitem-content:hover{color:#06f!important;background:#0066ff1a!important;background-color:#0066ff1a!important}::ng-deep .p-menu{border:none}::ng-deep .custom-scroll{scrollbar-gutter:inherit}::ng-deep .selected-menu-item{background-color:#0066ff1a!important;color:var(--primary-color)!important;border:1px solid rgba(68,72,109,.1)!important;border-radius:10px!important}::ng-deep .selected-menu-item .text-xl{color:var(--primary-color)!important}::ng-deep .selected-menu-item span{color:var(--primary-color)!important}::ng-deep .p-panelmenu .p-panelmenu-content{border:none!important}.application-title-wrapper{color:#9ea0b3;font-weight:500}.widget-menu-wrapper{margin-top:8px}.widget-menu-header-wrapper{padding:4px 4px 4px 16px}.widget-menu-container{height:calc(100% - 38px)}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}::ng-deep .document-sidebar-container .p-card{height:100%;box-shadow:none}::ng-deep .document-sidebar-container .p-card .p-card-content{height:100%;padding:0!important}::ng-deep .document-sidebar-container .p-card .p-card-body{height:100%;width:100%;padding:12px 8px;border-radius:10px;border:1px solid #e5e7eb}::ng-deep .document-sidebar-container .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content{border:none;color:var(--text-color);font-weight:400!important;background-color:var(--surface-0)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action{color:var(--text-color);font-weight:400!important;position:relative;padding:12px}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{position:absolute;right:0;top:16px;margin-right:7px;transform:rotate(90deg)!important;transition:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .company-action-wrapper:not(.p-disabled).p-highlight .p-panelmenu-header-content{margin:12px 0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content{background-color:transparent!important;border-radius:10px;padding:12px;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{transform:rotate(180deg)!important;transition:none!important;top:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link{background-color:var(--surface-0)!important;color:var(--text-color);padding:12px 6px!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);box-shadow:none!important;background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem.p-focus>.p-menuitem-content{background-color:#44486d1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:1px solid rgba(68,72,109,.1)!important;border-top:0!important;border-bottom-left-radius:10px;border-bottom-right-radius:10px}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator{border-top:1px solid rgba(68,72,109,.1)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}\n"], dependencies: [{ kind: "directive", type:
|
|
4286
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { catagories: "catagories", applicationNumber: "applicationNumber", contextId: "contextId" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\r\n <p-card class=\"widget-menu-wrapper h-full\">\r\n @if(applicationNumber){\r\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\r\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\r\n <div class=\"expand-icon-wrapper\">\r\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"catagories\" styleClass=\"w-full md:w-15rem\">\r\n <ng-template pTemplate=\"submenuheader\" let-item>\r\n <span [style]=\"{\r\n color : '#9EA0B3'\r\n }\">{{ item.label }}</span>\r\n </ng-template>\r\n <ng-template pTemplate=\"item\" let-item>\r\n <a pRipple \r\n class=\"flex align-items-center p-menuitem-link\"\r\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\r\n (click)=\"onMenuItemClick($event, item)\">\r\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\r\n <span class=\"ml-2\">{{ item.label }}</span>\r\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \r\n class=\"ml-auto\" \r\n [severity]=\"item.menuData?.badgeSeverity\" \r\n [value]=\"item.menuData?.badgeValue\" />\r\n </a>\r\n </ng-template>\r\n </p-menu>\r\n </div>\r\n </div>\r\n </p-card>\r\n</div>\r\n\r\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-menu .p-menuitem>.p-menuitem-content .p-menuitem-link{color:#1f2937}@media screen and (min-width: 768px){::ng-deep .md\\:w-15rem{width:100%!important}}::ng-deep .p-menu .p-menuitem:not(p-highlight):not(p-disabled)>.p-menuitem-content:hover{color:#06f!important;background:#0066ff1a!important;background-color:#0066ff1a!important}::ng-deep .p-menu{border:none}::ng-deep .custom-scroll{scrollbar-gutter:inherit}::ng-deep .selected-menu-item{background-color:#0066ff1a!important;color:var(--primary-color)!important;border:1px solid rgba(68,72,109,.1)!important;border-radius:10px!important}::ng-deep .selected-menu-item .text-xl{color:var(--primary-color)!important}::ng-deep .selected-menu-item span{color:var(--primary-color)!important}::ng-deep .p-panelmenu .p-panelmenu-content{border:none!important}.application-title-wrapper{color:#9ea0b3;font-weight:500}.widget-menu-wrapper{margin-top:8px}.widget-menu-header-wrapper{padding:4px 4px 4px 16px}.widget-menu-container{height:calc(100% - 38px)}.custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}::ng-deep .document-sidebar-container .p-card{height:100%;box-shadow:none}::ng-deep .document-sidebar-container .p-card .p-card-content{height:100%;padding:0!important}::ng-deep .document-sidebar-container .p-card .p-card-body{height:100%;width:100%;padding:12px 8px;border-radius:10px;border:1px solid #e5e7eb}::ng-deep .document-sidebar-container .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content{border:none;color:var(--text-color);font-weight:400!important;background-color:var(--surface-0)!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action{color:var(--text-color);font-weight:400!important;position:relative;padding:12px}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{position:absolute;right:0;top:16px;margin-right:7px;transform:rotate(90deg)!important;transition:none!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-panelmenu-header-action .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-header .p-panelmenu-header-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .company-action-wrapper:not(.p-disabled).p-highlight .p-panelmenu-header-content{margin:12px 0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content{background-color:transparent!important;border-radius:10px;padding:12px;border-bottom:0!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .no-highlight.p-panelmenu-header:not(.p-disabled).p-highlight .p-panelmenu-header-content .p-panelmenu-header-action .p-icon-wrapper{transform:rotate(180deg)!important;transition:none!important;top:0!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link{background-color:var(--surface-0)!important;color:var(--text-color);padding:12px 6px!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link .p-menuitem-text{max-width:75%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active{border:1px solid rgba(68,72,109,.1);border-radius:10px;padding:12px;color:var(--primary-color);box-shadow:none!important;background-color:#0066ff1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-icon{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem>.p-menuitem-content .p-menuitem-link-active .p-menuitem-text{color:var(--primary-color)}::ng-deep .widget-menu-wrapper .p-panelmenu .p-panelmenu-content .p-menuitem.p-focus>.p-menuitem-content{background-color:#44486d1a!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .p-panelmenu-expanded .p-panelmenu-content{border:1px solid rgba(68,72,109,.1)!important;border-top:0!important;border-bottom-left-radius:10px;border-bottom-right-radius:10px}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator{border-top:1px solid rgba(68,72,109,.1)!important}::ng-deep .widget-menu-wrapper .p-panelmenu-panel .widget-separator .p-panelmenu-header-content .p-panelmenu-header-action{padding:0!important}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7$2.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "component", type: i8$1.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i9.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }] });
|
|
3565
4287
|
}
|
|
3566
4288
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, decorators: [{
|
|
3567
4289
|
type: Component,
|
|
@@ -3724,7 +4446,7 @@ class DocumentContainerComponent {
|
|
|
3724
4446
|
this.subscription.unsubscribe();
|
|
3725
4447
|
}
|
|
3726
4448
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentStore }, { token: DocumentService }, { token: DocumentQuery }, { token: DocumentHttpService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3727
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"grid m-0 h-full flex\">\r\n <div class=\"col-12 md:col-3 lg:col-3\">\r\n <lib-documents-menu [catagories]=\"catagories\" [applicationNumber]=\"applicationNumber\" [contextId]=\"contextId\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"{'custom-scroll': true}\">\r\n <div>\r\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\r\n </div>\r\n <div >\r\n <lib-document-list [contextId]=\"contextId\" [documentListResponse]=\"documentListResponse\">\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:
|
|
4449
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"grid m-0 h-full flex\">\r\n <div class=\"col-12 md:col-3 lg:col-3\">\r\n <lib-documents-menu [catagories]=\"catagories\" [applicationNumber]=\"applicationNumber\" [contextId]=\"contextId\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"{'custom-scroll': true}\">\r\n <div>\r\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\r\n </div>\r\n <div >\r\n <lib-document-list [contextId]=\"contextId\" [documentListResponse]=\"documentListResponse\">\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: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId", "userList", "statusData", "categories"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentListResponse", "isUploadButtonVisible", "documentList", "status", "category", "searchKey"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["catagories", "applicationNumber", "contextId"] }] });
|
|
3728
4450
|
}
|
|
3729
4451
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
3730
4452
|
type: Component,
|
|
@@ -3773,7 +4495,7 @@ class FolderBlockComponent {
|
|
|
3773
4495
|
return folderBlockId;
|
|
3774
4496
|
}
|
|
3775
4497
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderBlockComponent, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
3776
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: { folderList: "folderList" }, ngImport: i0, template: "<div class=\"card p-0 folder-info\">\r\n <div class=\"text-900 text-xl font-semibold ml-2 mb-1\">Folders</div>\r\n <div class=\"grid m-0\">\r\n <div *ngFor=\"let folder of folderList\" class=\"col-12 md:col-6 xl:col-4 container-wrapper\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.documentCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.folderName }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container-wrapper:nth-child(3n+1){padding-left:0}.container-wrapper:nth-child(3n){padding-right:0}\n"], dependencies: [{ kind: "directive", type:
|
|
4498
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: { folderList: "folderList" }, ngImport: i0, template: "<div class=\"card p-0 folder-info\">\r\n <div class=\"text-900 text-xl font-semibold ml-2 mb-1\">Folders</div>\r\n <div class=\"grid m-0\">\r\n <div *ngFor=\"let folder of folderList\" class=\"col-12 md:col-6 xl:col-4 container-wrapper\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.documentCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.folderName }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container-wrapper:nth-child(3n+1){padding-left:0}.container-wrapper:nth-child(3n){padding-right:0}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
3777
4499
|
}
|
|
3778
4500
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderBlockComponent, decorators: [{
|
|
3779
4501
|
type: Component,
|
|
@@ -3811,7 +4533,7 @@ class DocumentListItemComponent {
|
|
|
3811
4533
|
this.documentClick.emit(document);
|
|
3812
4534
|
}
|
|
3813
4535
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3814
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-12 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1\"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'alert'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Alert\r\n </ng-container>\r\n </span>\r\n </div>\r\n <div class=\"document-type file-name-wrapper document-text-wrapper\">\r\n {{document.documentTypeName}}\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-alert{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}.file-name-wrapper{font-size:15px;font-weight:500}.document-text-wrapper{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type:
|
|
4536
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-12 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1\"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'alert'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Alert\r\n </ng-container>\r\n </span>\r\n </div>\r\n <div class=\"document-type file-name-wrapper document-text-wrapper\">\r\n {{document.documentTypeName}}\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-alert{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}.file-name-wrapper{font-size:15px;font-weight:500}.document-text-wrapper{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3815
4537
|
}
|
|
3816
4538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListItemComponent, decorators: [{
|
|
3817
4539
|
type: Component,
|
|
@@ -3890,146 +4612,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
3890
4612
|
}]
|
|
3891
4613
|
}], ctorParameters: () => [{ type: DocumentHelperService }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
|
|
3892
4614
|
|
|
3893
|
-
/**
|
|
3894
|
-
* Service for managing user session details.
|
|
3895
|
-
* @class SessionService
|
|
3896
|
-
* @typedef {SessionService}
|
|
3897
|
-
*/
|
|
3898
|
-
class SessionService {
|
|
3899
|
-
router;
|
|
3900
|
-
/**
|
|
3901
|
-
* Creates an instance of SessionService.
|
|
3902
|
-
* @param {Router} router - Angular Router for navigation.
|
|
3903
|
-
*/
|
|
3904
|
-
constructor(router) {
|
|
3905
|
-
this.router = router;
|
|
3906
|
-
}
|
|
3907
|
-
/**
|
|
3908
|
-
* Retrieves the current user's role from local storage.
|
|
3909
|
-
* @returns {string | null} The user's role, or null if not found.
|
|
3910
|
-
*/
|
|
3911
|
-
getUserRole() {
|
|
3912
|
-
return localStorage.getItem('role');
|
|
3913
|
-
}
|
|
3914
|
-
/**
|
|
3915
|
-
* Stores the user session data in local storage.
|
|
3916
|
-
* @param {any} data - The session data to store.
|
|
3917
|
-
*/
|
|
3918
|
-
setUserSession(data) {
|
|
3919
|
-
localStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
|
|
3920
|
-
}
|
|
3921
|
-
/**
|
|
3922
|
-
* Retrieves the stored user session data.
|
|
3923
|
-
* @returns {any | null} The parsed session data, or null if not found.
|
|
3924
|
-
*/
|
|
3925
|
-
getUserSession() {
|
|
3926
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
3927
|
-
return sessionData ? JSON.parse(sessionData) : null;
|
|
3928
|
-
}
|
|
3929
|
-
/**
|
|
3930
|
-
* Retrieves the user's permissions from the stored session data.
|
|
3931
|
-
* @returns {any | null} The user's permissions, or null if not found.
|
|
3932
|
-
*/
|
|
3933
|
-
getUserPermissions() {
|
|
3934
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
3935
|
-
return sessionData ? JSON.parse(sessionData).permissions : null;
|
|
3936
|
-
}
|
|
3937
|
-
/**
|
|
3938
|
-
* Retrieves the session ID from the stored session data.
|
|
3939
|
-
* @returns {any | null} The session ID, or null if not found.
|
|
3940
|
-
*/
|
|
3941
|
-
getSessionID() {
|
|
3942
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
3943
|
-
console.log(sessionData);
|
|
3944
|
-
if (sessionData) {
|
|
3945
|
-
const sessionId = JSON.parse(sessionData);
|
|
3946
|
-
console.log(sessionId);
|
|
3947
|
-
return sessionId;
|
|
3948
|
-
}
|
|
3949
|
-
return null;
|
|
3950
|
-
}
|
|
3951
|
-
/**
|
|
3952
|
-
* Clears all stored session data from local storage.
|
|
3953
|
-
*/
|
|
3954
|
-
clearSession() {
|
|
3955
|
-
localStorage.clear();
|
|
3956
|
-
}
|
|
3957
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3958
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
3959
|
-
}
|
|
3960
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, decorators: [{
|
|
3961
|
-
type: Injectable,
|
|
3962
|
-
args: [{
|
|
3963
|
-
providedIn: 'root'
|
|
3964
|
-
}]
|
|
3965
|
-
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
3966
|
-
|
|
3967
|
-
/**
|
|
3968
|
-
* Directive to conditionally show or hide elements based on user permissions.
|
|
3969
|
-
* @class HasPermissionDirective
|
|
3970
|
-
* @typedef {HasPermissionDirective}
|
|
3971
|
-
*/
|
|
3972
|
-
class HasPermissionDirective {
|
|
3973
|
-
el;
|
|
3974
|
-
renderer;
|
|
3975
|
-
sessionService;
|
|
3976
|
-
/**
|
|
3977
|
-
* The required permission(s) to display the element.
|
|
3978
|
-
* Accepts a single string or an array of strings.
|
|
3979
|
-
* @type {string | string[]}
|
|
3980
|
-
*/
|
|
3981
|
-
permission;
|
|
3982
|
-
/**
|
|
3983
|
-
* Creates an instance of HasPermissionDirective.
|
|
3984
|
-
* @param {ElementRef} el - Reference to the host element.
|
|
3985
|
-
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
3986
|
-
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
3987
|
-
*/
|
|
3988
|
-
constructor(el, renderer, sessionService) {
|
|
3989
|
-
this.el = el;
|
|
3990
|
-
this.renderer = renderer;
|
|
3991
|
-
this.sessionService = sessionService;
|
|
3992
|
-
}
|
|
3993
|
-
/**
|
|
3994
|
-
* Lifecycle hook that is called when input properties change.
|
|
3995
|
-
* @param {SimpleChanges} changes - The changes in input properties.
|
|
3996
|
-
*/
|
|
3997
|
-
ngOnChanges(changes) {
|
|
3998
|
-
if (changes['permission']) {
|
|
3999
|
-
this.checkPermission();
|
|
4000
|
-
}
|
|
4001
|
-
}
|
|
4002
|
-
/**
|
|
4003
|
-
* Checks if the user has the required permission(s).
|
|
4004
|
-
* Hides the element if the permission is not found.
|
|
4005
|
-
*/
|
|
4006
|
-
checkPermission() {
|
|
4007
|
-
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
4008
|
-
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
4009
|
-
const requiredPermissions = Array.isArray(this.permission)
|
|
4010
|
-
? this.permission
|
|
4011
|
-
: [this.permission];
|
|
4012
|
-
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
4013
|
-
if (!hasPermission) {
|
|
4014
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
4015
|
-
}
|
|
4016
|
-
else {
|
|
4017
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
4018
|
-
}
|
|
4019
|
-
}
|
|
4020
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4021
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
4022
|
-
}
|
|
4023
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
4024
|
-
type: Directive,
|
|
4025
|
-
args: [{
|
|
4026
|
-
selector: '[permission]',
|
|
4027
|
-
standalone: false
|
|
4028
|
-
}]
|
|
4029
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
4030
|
-
type: Input
|
|
4031
|
-
}] } });
|
|
4032
|
-
|
|
4033
4615
|
/**
|
|
4034
4616
|
* Description placeholder
|
|
4035
4617
|
* @class LinkedDocumentComponent
|
|
@@ -4081,10 +4663,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4081
4663
|
|
|
4082
4664
|
class SharedModule {
|
|
4083
4665
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4084
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, declarations: [TablePrimaryComponent], imports: [CommonModule,
|
|
4666
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, declarations: [TablePrimaryComponent, HasPermissionDirective], imports: [CommonModule,
|
|
4085
4667
|
TableModule,
|
|
4086
4668
|
ButtonModule,
|
|
4087
|
-
RippleModule], exports: [TablePrimaryComponent] });
|
|
4669
|
+
RippleModule], exports: [TablePrimaryComponent, HasPermissionDirective] });
|
|
4088
4670
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, imports: [CommonModule,
|
|
4089
4671
|
TableModule,
|
|
4090
4672
|
ButtonModule,
|
|
@@ -4093,14 +4675,14 @@ class SharedModule {
|
|
|
4093
4675
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, decorators: [{
|
|
4094
4676
|
type: NgModule,
|
|
4095
4677
|
args: [{
|
|
4096
|
-
declarations: [TablePrimaryComponent],
|
|
4678
|
+
declarations: [TablePrimaryComponent, HasPermissionDirective],
|
|
4097
4679
|
imports: [
|
|
4098
4680
|
CommonModule,
|
|
4099
4681
|
TableModule,
|
|
4100
4682
|
ButtonModule,
|
|
4101
4683
|
RippleModule
|
|
4102
4684
|
],
|
|
4103
|
-
exports: [TablePrimaryComponent]
|
|
4685
|
+
exports: [TablePrimaryComponent, HasPermissionDirective]
|
|
4104
4686
|
}]
|
|
4105
4687
|
}] });
|
|
4106
4688
|
|
|
@@ -4155,17 +4737,15 @@ class DocumentModule {
|
|
|
4155
4737
|
* A directive to show the document.
|
|
4156
4738
|
*/
|
|
4157
4739
|
DocumentDirective,
|
|
4158
|
-
/**
|
|
4159
|
-
* A directive to give permission.
|
|
4160
|
-
*/
|
|
4161
|
-
HasPermissionDirective,
|
|
4162
4740
|
/**
|
|
4163
4741
|
* A component which have linked documents.
|
|
4164
4742
|
*/
|
|
4165
4743
|
LinkedDocumentComponent,
|
|
4166
4744
|
DocumentsMenuComponent,
|
|
4167
4745
|
UserListComponent,
|
|
4168
|
-
DocumentStatusComponent
|
|
4746
|
+
DocumentStatusComponent,
|
|
4747
|
+
DocumentActionsComponent,
|
|
4748
|
+
DocumentSearchComponent], imports: [
|
|
4169
4749
|
/**
|
|
4170
4750
|
* Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
|
|
4171
4751
|
*/
|
|
@@ -4238,11 +4818,8 @@ class DocumentModule {
|
|
|
4238
4818
|
PanelMenuModule,
|
|
4239
4819
|
CardModule,
|
|
4240
4820
|
TableModule,
|
|
4241
|
-
SharedModule
|
|
4242
|
-
|
|
4243
|
-
* A directive to give permission.
|
|
4244
|
-
*/
|
|
4245
|
-
HasPermissionDirective,
|
|
4821
|
+
SharedModule,
|
|
4822
|
+
InputTextareaModule], exports: [
|
|
4246
4823
|
/**
|
|
4247
4824
|
* Exports the `DocumentContainerComponent` to be used in other modules.
|
|
4248
4825
|
*/
|
|
@@ -4251,6 +4828,10 @@ class DocumentModule {
|
|
|
4251
4828
|
* Exports the `DocumentViewerComponent` to be used in other modules.
|
|
4252
4829
|
*/
|
|
4253
4830
|
DocumentViewerComponent,
|
|
4831
|
+
/**
|
|
4832
|
+
* Exports the `DocumentActionsComponent` to be used in other modules.
|
|
4833
|
+
*/
|
|
4834
|
+
DocumentActionsComponent,
|
|
4254
4835
|
/**
|
|
4255
4836
|
* A component to display a list of documents.
|
|
4256
4837
|
* DocumentListComponent
|
|
@@ -4259,7 +4840,11 @@ class DocumentModule {
|
|
|
4259
4840
|
/**
|
|
4260
4841
|
* A directive to show the document.
|
|
4261
4842
|
*/
|
|
4262
|
-
DocumentDirective
|
|
4843
|
+
DocumentDirective,
|
|
4844
|
+
/**
|
|
4845
|
+
* A component for searching documents.
|
|
4846
|
+
*/
|
|
4847
|
+
DocumentSearchComponent] });
|
|
4263
4848
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentModule, providers: [
|
|
4264
4849
|
/**
|
|
4265
4850
|
* Provide the messageservice to be used in other components.
|
|
@@ -4364,7 +4949,8 @@ class DocumentModule {
|
|
|
4364
4949
|
PanelMenuModule,
|
|
4365
4950
|
CardModule,
|
|
4366
4951
|
TableModule,
|
|
4367
|
-
SharedModule
|
|
4952
|
+
SharedModule,
|
|
4953
|
+
InputTextareaModule] });
|
|
4368
4954
|
}
|
|
4369
4955
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentModule, decorators: [{
|
|
4370
4956
|
type: NgModule,
|
|
@@ -4411,10 +4997,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4411
4997
|
* A directive to show the document.
|
|
4412
4998
|
*/
|
|
4413
4999
|
DocumentDirective,
|
|
4414
|
-
/**
|
|
4415
|
-
* A directive to give permission.
|
|
4416
|
-
*/
|
|
4417
|
-
HasPermissionDirective,
|
|
4418
5000
|
/**
|
|
4419
5001
|
* A component which have linked documents.
|
|
4420
5002
|
*/
|
|
@@ -4422,6 +5004,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4422
5004
|
DocumentsMenuComponent,
|
|
4423
5005
|
UserListComponent,
|
|
4424
5006
|
DocumentStatusComponent,
|
|
5007
|
+
DocumentActionsComponent,
|
|
5008
|
+
DocumentSearchComponent,
|
|
4425
5009
|
],
|
|
4426
5010
|
imports: [
|
|
4427
5011
|
/**
|
|
@@ -4496,13 +5080,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4496
5080
|
PanelMenuModule,
|
|
4497
5081
|
CardModule,
|
|
4498
5082
|
TableModule,
|
|
4499
|
-
SharedModule
|
|
5083
|
+
SharedModule,
|
|
5084
|
+
InputTextareaModule
|
|
4500
5085
|
],
|
|
4501
5086
|
exports: [
|
|
4502
|
-
/**
|
|
4503
|
-
* A directive to give permission.
|
|
4504
|
-
*/
|
|
4505
|
-
HasPermissionDirective,
|
|
4506
5087
|
/**
|
|
4507
5088
|
* Exports the `DocumentContainerComponent` to be used in other modules.
|
|
4508
5089
|
*/
|
|
@@ -4511,6 +5092,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4511
5092
|
* Exports the `DocumentViewerComponent` to be used in other modules.
|
|
4512
5093
|
*/
|
|
4513
5094
|
DocumentViewerComponent,
|
|
5095
|
+
/**
|
|
5096
|
+
* Exports the `DocumentActionsComponent` to be used in other modules.
|
|
5097
|
+
*/
|
|
5098
|
+
DocumentActionsComponent,
|
|
4514
5099
|
/**
|
|
4515
5100
|
* A component to display a list of documents.
|
|
4516
5101
|
* DocumentListComponent
|
|
@@ -4520,6 +5105,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4520
5105
|
* A directive to show the document.
|
|
4521
5106
|
*/
|
|
4522
5107
|
DocumentDirective,
|
|
5108
|
+
/**
|
|
5109
|
+
* A component for searching documents.
|
|
5110
|
+
*/
|
|
5111
|
+
DocumentSearchComponent,
|
|
4523
5112
|
],
|
|
4524
5113
|
providers: [
|
|
4525
5114
|
/**
|
|
@@ -4564,5 +5153,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
4564
5153
|
* Generated bundle index. Do not edit.
|
|
4565
5154
|
*/
|
|
4566
5155
|
|
|
4567
|
-
export { DocumentContainerComponent, DocumentDirective, DocumentHistoryComponent, DocumentListComponent, DocumentModule, DocumentTableBuilderService, DocumentViewerComponent, HasPermissionDirective };
|
|
5156
|
+
export { DocumentActionsComponent, DocumentContainerComponent, DocumentDirective, DocumentHistoryComponent, DocumentListComponent, DocumentModule, DocumentSearchComponent, DocumentTableBuilderService, DocumentViewerComponent, HasPermissionDirective };
|
|
4568
5157
|
//# sourceMappingURL=cat-documents-ng.mjs.map
|