cat-documents-ng 0.2.31 → 0.2.34
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 +23 -0
- package/Shared/constant/SHARED.d.ts +29 -5
- package/Shared/shared.module.d.ts +11 -0
- package/fesm2022/cat-documents-ng.mjs +1264 -303
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-container/document-container.component.d.ts +1 -0
- package/lib/document/components/document-list/document-list.component.d.ts +20 -1
- package/lib/document/components/document-status/document-status.component.d.ts +25 -0
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +17 -2
- package/lib/document/components/folder-container/folder-container.component.d.ts +14 -1
- package/lib/document/components/user-list/user-list.component.d.ts +32 -0
- package/lib/document/document.module.d.ts +25 -21
- package/lib/document/models/document-status.model.d.ts +6 -0
- package/lib/document/services/document-http.service.d.ts +9 -0
- package/lib/document/services/document-table-builder.service.d.ts +52 -0
- package/lib/document/services/document.service.d.ts +58 -2
- package/lib/document/state/document.query.d.ts +43 -0
- package/lib/document/state/document.state.d.ts +4 -0
- package/lib/document/state/document.store.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,46 +1,51 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable,
|
|
3
|
-
import * as
|
|
2
|
+
import { Injectable, EventEmitter, Component, Output, Input, ViewEncapsulation, ViewChild, Directive, NgModule, APP_INITIALIZER } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { firstValueFrom, tap, EMPTY, catchError, throwError, BehaviorSubject, Subscription } from 'rxjs';
|
|
5
|
+
import { firstValueFrom, tap, EMPTY, catchError, throwError, BehaviorSubject, combineLatest, Subscription } from 'rxjs';
|
|
6
6
|
import { __decorate } from 'tslib';
|
|
7
7
|
import { EntityStore, StoreConfig, QueryEntity } from '@datorama/akita';
|
|
8
8
|
import * as i2 from '@angular/common/http';
|
|
9
|
-
import { HttpClientModule } from '@angular/common/http';
|
|
9
|
+
import { HttpParams, HttpClientModule } from '@angular/common/http';
|
|
10
|
+
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
11
|
+
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
|
10
12
|
import * as i3 from 'primeng/api';
|
|
11
13
|
import { MessageService } from 'primeng/api';
|
|
12
|
-
import * as
|
|
13
|
-
import { AccordionModule } from 'primeng/accordion';
|
|
14
|
-
import * as i7 from 'primeng/button';
|
|
14
|
+
import * as i8 from 'primeng/button';
|
|
15
15
|
import { ButtonModule } from 'primeng/button';
|
|
16
|
-
import * as
|
|
16
|
+
import * as i9 from 'primeng/sidebar';
|
|
17
17
|
import { SidebarModule } from 'primeng/sidebar';
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
18
|
+
import * as i10 from 'primeng/messages';
|
|
19
|
+
import * as i11 from '@angular/forms';
|
|
20
20
|
import { FormsModule } from '@angular/forms';
|
|
21
|
-
import * as
|
|
21
|
+
import * as i12 from 'primeng/dialog';
|
|
22
22
|
import { DialogModule } from 'primeng/dialog';
|
|
23
|
-
import * as
|
|
23
|
+
import * as i13 from 'primeng/dropdown';
|
|
24
24
|
import { DropdownModule } from 'primeng/dropdown';
|
|
25
|
-
import * as
|
|
25
|
+
import * as i14 from 'primeng/inputtext';
|
|
26
26
|
import { InputTextModule } from 'primeng/inputtext';
|
|
27
|
-
import * as
|
|
27
|
+
import * as i2$1 from 'primeng/table';
|
|
28
|
+
import { TableModule } from 'primeng/table';
|
|
29
|
+
import * as i5 from 'primeng/ripple';
|
|
30
|
+
import { RippleModule } from 'primeng/ripple';
|
|
31
|
+
import * as i7 from 'primeng/fileupload';
|
|
28
32
|
import { FileUploadModule } from 'primeng/fileupload';
|
|
29
|
-
import * as i8 from 'primeng/progressbar';
|
|
33
|
+
import * as i8$1 from 'primeng/progressbar';
|
|
30
34
|
import { ProgressBarModule } from 'primeng/progressbar';
|
|
31
|
-
import * as i4 from 'ng2-pdf-viewer';
|
|
35
|
+
import * as i4$1 from 'ng2-pdf-viewer';
|
|
32
36
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
|
33
|
-
import * as
|
|
34
|
-
import * as i3$1 from 'primeng/badge';
|
|
37
|
+
import * as i5$1 from 'primeng/badge';
|
|
35
38
|
import { BadgeModule } from 'primeng/badge';
|
|
36
|
-
import * as
|
|
39
|
+
import * as i6 from 'primeng/menu';
|
|
37
40
|
import { MenuModule } from 'primeng/menu';
|
|
38
|
-
import * as
|
|
41
|
+
import * as i7$1 from 'primeng/card';
|
|
39
42
|
import { CardModule } from 'primeng/card';
|
|
43
|
+
import { AccordionModule } from 'primeng/accordion';
|
|
40
44
|
import { ListboxModule } from 'primeng/listbox';
|
|
41
45
|
import { TimelineModule } from 'primeng/timeline';
|
|
42
46
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
43
47
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
48
|
+
import * as i1 from '@angular/router';
|
|
44
49
|
import { PanelMenuModule } from 'primeng/panelmenu';
|
|
45
50
|
|
|
46
51
|
/**
|
|
@@ -313,41 +318,62 @@ const DUMMYDOCUMENTLIST = [
|
|
|
313
318
|
* `FOLDERPANEL` is a mock list of folder data representing various folders in the application.
|
|
314
319
|
* Each folder contains an ID, file count, text description, missing files count, and pending files count.
|
|
315
320
|
*/
|
|
316
|
-
const
|
|
321
|
+
const USERLIST = [
|
|
322
|
+
{
|
|
323
|
+
_id: "1",
|
|
324
|
+
username: "John Smith",
|
|
325
|
+
approveDocumentCount: 15,
|
|
326
|
+
pendingDocumentCount: 3
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
_id: "2",
|
|
330
|
+
username: "Sarah Johnson",
|
|
331
|
+
approveDocumentCount: 8,
|
|
332
|
+
pendingDocumentCount: 7
|
|
333
|
+
},
|
|
317
334
|
{
|
|
318
|
-
_id:
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
pendingFiles: 2,
|
|
335
|
+
_id: "3",
|
|
336
|
+
username: "Michael Brown",
|
|
337
|
+
approveDocumentCount: 22,
|
|
338
|
+
pendingDocumentCount: 1
|
|
323
339
|
},
|
|
324
340
|
{
|
|
325
|
-
_id:
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
341
|
+
_id: "4",
|
|
342
|
+
username: "Emily Davis",
|
|
343
|
+
approveDocumentCount: 12,
|
|
344
|
+
pendingDocumentCount: 5
|
|
345
|
+
}
|
|
346
|
+
];
|
|
347
|
+
const SAMPLE_STATUS_DATA = [
|
|
348
|
+
{
|
|
349
|
+
status: "Approved",
|
|
350
|
+
count: 4,
|
|
351
|
+
color: "#10b981",
|
|
352
|
+
icon: "pi pi-check"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
status: "Pending",
|
|
356
|
+
count: 5,
|
|
357
|
+
color: "#6b7280",
|
|
358
|
+
icon: "pi pi-clock"
|
|
330
359
|
},
|
|
331
360
|
{
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
pendingFiles: 0,
|
|
361
|
+
status: "Reviewing",
|
|
362
|
+
count: 1,
|
|
363
|
+
color: "#f59e0b",
|
|
364
|
+
icon: "pi pi-search"
|
|
337
365
|
},
|
|
338
366
|
{
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
pendingFiles: 0,
|
|
367
|
+
status: "Rejected",
|
|
368
|
+
count: 2,
|
|
369
|
+
color: "#ef4444",
|
|
370
|
+
icon: "pi pi-times"
|
|
344
371
|
},
|
|
345
372
|
{
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
pendingFiles: 3,
|
|
373
|
+
status: "Alert",
|
|
374
|
+
count: 12,
|
|
375
|
+
color: "#dc2626",
|
|
376
|
+
icon: "pi pi-exclamation-circle"
|
|
351
377
|
}
|
|
352
378
|
];
|
|
353
379
|
/**
|
|
@@ -418,6 +444,165 @@ const DocumentAlertList = [
|
|
|
418
444
|
{ status: 'Pending', isAlert: true, alertMessage: 'The name on the payslip does not match either the driver name or the policyholder name.' },
|
|
419
445
|
{ status: 'Verified', isAlert: false, alertMessage: 'Document is verified successfully.' },
|
|
420
446
|
];
|
|
447
|
+
/**
|
|
448
|
+
* Dummy data for document sections with detailed document lists.
|
|
449
|
+
* Based on the document management interface structure.
|
|
450
|
+
* @type {Array<{header: string, description: string, pendingDocument: number, approvedDocument: number, list: Array<{documentName: string, documentType: string, documentUrl: string, status: string, applicantName: string, uploadedTime: string}>}>}
|
|
451
|
+
*/
|
|
452
|
+
const DUMMY_DOCUMENT_SECTIONS = [
|
|
453
|
+
{
|
|
454
|
+
header: "Identity",
|
|
455
|
+
description: "Personal identification documents required for verification",
|
|
456
|
+
pendingDocument: 1,
|
|
457
|
+
approvedDocument: 1,
|
|
458
|
+
list: [
|
|
459
|
+
{
|
|
460
|
+
documentName: "passport_emma_wilson_2025.pdf",
|
|
461
|
+
documentType: "Passport",
|
|
462
|
+
documentUrl: "https://example.com/documents/passport_emma_wilson_2025.pdf",
|
|
463
|
+
status: "Pending",
|
|
464
|
+
applicantName: "Charlotte Anderson",
|
|
465
|
+
uploadedTime: "28 May 2025"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
documentName: "driving_license_benjamin_mitchell_2025.jpg",
|
|
469
|
+
documentType: "Driving License",
|
|
470
|
+
documentUrl: "https://example.com/documents/driving_license_benjamin_mitchell_2025.jpg",
|
|
471
|
+
status: "Approved",
|
|
472
|
+
applicantName: "Benjamin Mitchell",
|
|
473
|
+
uploadedTime: "27 May 2025"
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
documentName: "british_gas_bill_may_2025.pdf",
|
|
477
|
+
documentType: "Utility Bill",
|
|
478
|
+
documentUrl: "https://example.com/documents/british_gas_bill_may_2025.pdf",
|
|
479
|
+
status: "Alert",
|
|
480
|
+
applicantName: "Sophia Reynolds",
|
|
481
|
+
uploadedTime: "26 May 2025"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
documentName: "council_tax_oliver_thompson_2025_2026.pdf",
|
|
485
|
+
documentType: "Council Tax Bill",
|
|
486
|
+
documentUrl: "https://example.com/documents/council_tax_oliver_thompson_2025_2026.pdf",
|
|
487
|
+
status: "Uploaded",
|
|
488
|
+
applicantName: "Oliver Thompson",
|
|
489
|
+
uploadedTime: "30 May 2025"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
documentName: "certified_id_oliver_thompson_2025.pdf",
|
|
493
|
+
documentType: "Certified ID",
|
|
494
|
+
documentUrl: "https://example.com/documents/certified_id_oliver_thompson_2025.pdf",
|
|
495
|
+
status: "Reviewing",
|
|
496
|
+
applicantName: "Oliver Thompson",
|
|
497
|
+
uploadedTime: "02 Jun 2025"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
documentName: "proof_of_address_oliver_thompson_2025.pdf",
|
|
501
|
+
documentType: "Proof of Address",
|
|
502
|
+
documentUrl: "https://example.com/documents/proof_of_address_oliver_thompson_2025.pdf",
|
|
503
|
+
status: "Rejected",
|
|
504
|
+
applicantName: "Oliver Thompson",
|
|
505
|
+
uploadedTime: "02 Jun 2025"
|
|
506
|
+
}
|
|
507
|
+
]
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
header: "Income",
|
|
511
|
+
description: "Employment and income verification documents",
|
|
512
|
+
pendingDocument: 1,
|
|
513
|
+
approvedDocument: 1,
|
|
514
|
+
list: [
|
|
515
|
+
{
|
|
516
|
+
documentName: "latest_payslip_charlotte_2025.pdf",
|
|
517
|
+
documentType: "Latest Payslip",
|
|
518
|
+
documentUrl: "https://example.com/documents/latest_payslip_charlotte_2025.pdf",
|
|
519
|
+
status: "Pending",
|
|
520
|
+
applicantName: "Charlotte Anderson",
|
|
521
|
+
uploadedTime: "29 May 2025"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
documentName: "p60_document_sophia_2025.pdf",
|
|
525
|
+
documentType: "P60 Document",
|
|
526
|
+
documentUrl: "https://example.com/documents/p60_document_sophia_2025.pdf",
|
|
527
|
+
status: "Alert",
|
|
528
|
+
applicantName: "Sophia Reynolds",
|
|
529
|
+
uploadedTime: "26 May 2025"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
documentName: "employer_reference_benjamin_2025.pdf",
|
|
533
|
+
documentType: "Employer Reference",
|
|
534
|
+
documentUrl: "https://example.com/documents/employer_reference_benjamin_2025.pdf",
|
|
535
|
+
status: "Approved",
|
|
536
|
+
applicantName: "Benjamin Mitchell",
|
|
537
|
+
uploadedTime: "27 May 2025"
|
|
538
|
+
}
|
|
539
|
+
]
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
header: "Affordability",
|
|
543
|
+
description: "Financial assessment and planning documents",
|
|
544
|
+
pendingDocument: 1,
|
|
545
|
+
approvedDocument: 0,
|
|
546
|
+
list: [
|
|
547
|
+
{
|
|
548
|
+
documentName: "bank_statements_charlotte_2025.pdf",
|
|
549
|
+
documentType: "Bank Statements",
|
|
550
|
+
documentUrl: "https://example.com/documents/bank_statements_charlotte_2025.pdf",
|
|
551
|
+
status: "Pending",
|
|
552
|
+
applicantName: "Charlotte Anderson",
|
|
553
|
+
uploadedTime: "28 May 2025"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
documentName: "budget_planner_sophia_2025.xlsx",
|
|
557
|
+
documentType: "Budget Planner",
|
|
558
|
+
documentUrl: "https://example.com/documents/budget_planner_sophia_2025.xlsx",
|
|
559
|
+
status: "Alert",
|
|
560
|
+
applicantName: "Sophia Reynolds",
|
|
561
|
+
uploadedTime: "25 May 2025"
|
|
562
|
+
}
|
|
563
|
+
]
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
header: "Credit Conduct",
|
|
567
|
+
description: "Credit history and mortgage documentation",
|
|
568
|
+
pendingDocument: 1,
|
|
569
|
+
approvedDocument: 0,
|
|
570
|
+
list: [
|
|
571
|
+
{
|
|
572
|
+
documentName: "bank_statements_charlotte_2025.pdf",
|
|
573
|
+
documentType: "Bank Statements",
|
|
574
|
+
documentUrl: "https://example.com/documents/bank_statements_charlotte_2025.pdf",
|
|
575
|
+
status: "Pending",
|
|
576
|
+
applicantName: "Charlotte Anderson",
|
|
577
|
+
uploadedTime: "28 May 2025"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
documentName: "budget_planner_sophia_2025.xlsx",
|
|
581
|
+
documentType: "Budget Planner",
|
|
582
|
+
documentUrl: "https://example.com/documents/budget_planner_sophia_2025.xlsx",
|
|
583
|
+
status: "Alert",
|
|
584
|
+
applicantName: "Sophia Reynolds",
|
|
585
|
+
uploadedTime: "25 May 2025"
|
|
586
|
+
}
|
|
587
|
+
]
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
header: "KYC",
|
|
591
|
+
description: "Know Your Customer verification documents",
|
|
592
|
+
pendingDocument: 1,
|
|
593
|
+
approvedDocument: 0,
|
|
594
|
+
list: [
|
|
595
|
+
{
|
|
596
|
+
documentName: "kyc_checklist_charlotte_2025.pdf",
|
|
597
|
+
documentType: "KYC Checklist",
|
|
598
|
+
documentUrl: "https://example.com/documents/kyc_checklist_charlotte_2025.pdf",
|
|
599
|
+
status: "Pending",
|
|
600
|
+
applicantName: "Charlotte Anderson",
|
|
601
|
+
uploadedTime: "28 May 2025"
|
|
602
|
+
}
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
];
|
|
421
606
|
|
|
422
607
|
/**
|
|
423
608
|
* A utility class containing common error messages.
|
|
@@ -474,7 +659,13 @@ function createInitialState() {
|
|
|
474
659
|
documentAlert: { _id: '' },
|
|
475
660
|
folders: [],
|
|
476
661
|
messages: [],
|
|
477
|
-
documentList: []
|
|
662
|
+
documentList: [],
|
|
663
|
+
// Initialize new selection properties
|
|
664
|
+
selectedMenuItem: null,
|
|
665
|
+
selectedUserId: null,
|
|
666
|
+
selectedStatus: null,
|
|
667
|
+
// Initialize user list visibility to true
|
|
668
|
+
showUserList: true
|
|
478
669
|
};
|
|
479
670
|
}
|
|
480
671
|
|
|
@@ -513,6 +704,37 @@ let DocumentStore = class DocumentStore extends EntityStore {
|
|
|
513
704
|
setDocumentList(documents) {
|
|
514
705
|
this.update({ documents: documents });
|
|
515
706
|
}
|
|
707
|
+
// New methods for selection state management
|
|
708
|
+
setSelectedMenuItem(menuItem) {
|
|
709
|
+
this.update({ selectedMenuItem: menuItem });
|
|
710
|
+
}
|
|
711
|
+
setSelectedUserId(userId) {
|
|
712
|
+
this.update({ selectedUserId: userId });
|
|
713
|
+
}
|
|
714
|
+
setSelectedStatus(status) {
|
|
715
|
+
this.update({ selectedStatus: status });
|
|
716
|
+
}
|
|
717
|
+
// Method to update all selection properties at once
|
|
718
|
+
setSelectionState(menuItem, userId, status) {
|
|
719
|
+
this.update({
|
|
720
|
+
selectedMenuItem: menuItem,
|
|
721
|
+
selectedUserId: userId,
|
|
722
|
+
selectedStatus: status
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
// Method to clear all selection state
|
|
726
|
+
clearSelectionState() {
|
|
727
|
+
this.update({
|
|
728
|
+
selectedMenuItem: null,
|
|
729
|
+
selectedUserId: null,
|
|
730
|
+
selectedStatus: null,
|
|
731
|
+
showUserList: true
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
// Method to control user list visibility
|
|
735
|
+
setShowUserList(show) {
|
|
736
|
+
this.update({ showUserList: show });
|
|
737
|
+
}
|
|
516
738
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
517
739
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, providedIn: 'root' });
|
|
518
740
|
};
|
|
@@ -776,6 +998,65 @@ class DocumentQuery extends QueryEntity {
|
|
|
776
998
|
selectDocumets() {
|
|
777
999
|
return this.select((state) => state.documentList);
|
|
778
1000
|
}
|
|
1001
|
+
// New query methods for selection state
|
|
1002
|
+
/**
|
|
1003
|
+
* Selects the currently selected menu item.
|
|
1004
|
+
* @returns {Observable<string | null>} Observable that emits the currently selected menu item.
|
|
1005
|
+
*/
|
|
1006
|
+
selectSelectedMenuItem() {
|
|
1007
|
+
return this.select((state) => state.selectedMenuItem);
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Selects the currently selected user ID.
|
|
1011
|
+
* @returns {Observable<string | null>} Observable that emits the currently selected user ID.
|
|
1012
|
+
*/
|
|
1013
|
+
selectSelectedUserId() {
|
|
1014
|
+
return this.select((state) => state.selectedUserId);
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Selects the currently selected status.
|
|
1018
|
+
* @returns {Observable<string | null>} Observable that emits the currently selected status.
|
|
1019
|
+
*/
|
|
1020
|
+
selectSelectedStatus() {
|
|
1021
|
+
return this.select((state) => state.selectedStatus);
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Selects all selection state properties (menu item, user ID, status).
|
|
1025
|
+
* @returns {Observable<{menuItem: string | null, userId: string | null, status: string | null}>} Observable that emits the current selection state.
|
|
1026
|
+
*/
|
|
1027
|
+
selectSelectionState() {
|
|
1028
|
+
return this.select((state) => ({
|
|
1029
|
+
menuItem: state.selectedMenuItem,
|
|
1030
|
+
userId: state.selectedUserId,
|
|
1031
|
+
status: state.selectedStatus
|
|
1032
|
+
}));
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Gets the current selection state values (synchronous).
|
|
1036
|
+
* @returns {Object} The current selection state values.
|
|
1037
|
+
*/
|
|
1038
|
+
getSelectionState() {
|
|
1039
|
+
const state = this.getValue();
|
|
1040
|
+
return {
|
|
1041
|
+
menuItem: state.selectedMenuItem,
|
|
1042
|
+
userId: state.selectedUserId,
|
|
1043
|
+
status: state.selectedStatus
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Selects the user list visibility state.
|
|
1048
|
+
* @returns {Observable<boolean>} Observable that emits the current user list visibility.
|
|
1049
|
+
*/
|
|
1050
|
+
selectShowUserList() {
|
|
1051
|
+
return this.select((state) => state.showUserList);
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Gets the current user list visibility value (synchronous).
|
|
1055
|
+
* @returns {boolean} The current user list visibility.
|
|
1056
|
+
*/
|
|
1057
|
+
getShowUserList() {
|
|
1058
|
+
return this.getValue().showUserList;
|
|
1059
|
+
}
|
|
779
1060
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
780
1061
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, providedIn: 'root' });
|
|
781
1062
|
}
|
|
@@ -877,6 +1158,34 @@ class DocumentHttpService {
|
|
|
877
1158
|
return throwError(() => new Error(error));
|
|
878
1159
|
}));
|
|
879
1160
|
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Fetches documents based on selection criteria (menu item, user ID, and status).
|
|
1163
|
+
* This method sends an HTTP GET request with query parameters for the selected filters.
|
|
1164
|
+
* @param {string | null} menuItem - The selected menu item filter.
|
|
1165
|
+
* @param {string | null} userId - The selected user ID filter.
|
|
1166
|
+
* @param {string | null} status - The selected status filter.
|
|
1167
|
+
* @returns {Observable<any>} An observable that emits the filtered document data.
|
|
1168
|
+
*/
|
|
1169
|
+
getDocumentsBySelection(menuItem, userId, status) {
|
|
1170
|
+
let params = new HttpParams();
|
|
1171
|
+
if (menuItem) {
|
|
1172
|
+
params = params.set('menuItem', menuItem);
|
|
1173
|
+
}
|
|
1174
|
+
if (userId) {
|
|
1175
|
+
params = params.set('userId', userId);
|
|
1176
|
+
}
|
|
1177
|
+
if (status) {
|
|
1178
|
+
params = params.set('status', status);
|
|
1179
|
+
}
|
|
1180
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/filter`, { params }).pipe(tap((response) => {
|
|
1181
|
+
// Update the store with the filtered results
|
|
1182
|
+
if (response.documents) {
|
|
1183
|
+
this.documentStore.setDocumentList(response.documents);
|
|
1184
|
+
}
|
|
1185
|
+
}), catchError((error) => {
|
|
1186
|
+
return throwError(() => new Error(error));
|
|
1187
|
+
}));
|
|
1188
|
+
}
|
|
880
1189
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
881
1190
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, providedIn: 'root' });
|
|
882
1191
|
}
|
|
@@ -888,54 +1197,288 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
888
1197
|
}], ctorParameters: () => [{ type: DocumentStore }, { type: i2.HttpClient }, { type: AppConfigService }] });
|
|
889
1198
|
|
|
890
1199
|
/**
|
|
891
|
-
*
|
|
892
|
-
* providing filtering functionality based on folder IDs.
|
|
893
|
-
*
|
|
894
|
-
* It uses data from the `DocumentStore` and constants from the `SHARED` configuration
|
|
895
|
-
* to display missing and pending file counts.
|
|
1200
|
+
* Service to manage the document data and selection state
|
|
896
1201
|
*/
|
|
897
|
-
class
|
|
1202
|
+
class DocumentService {
|
|
898
1203
|
documentStore;
|
|
1204
|
+
documentQuery;
|
|
1205
|
+
documentHttpService;
|
|
1206
|
+
documentSubject$ = new BehaviorSubject(null);
|
|
1207
|
+
constructor(documentStore, documentQuery, documentHttpService) {
|
|
1208
|
+
this.documentStore = documentStore;
|
|
1209
|
+
this.documentQuery = documentQuery;
|
|
1210
|
+
this.documentHttpService = documentHttpService;
|
|
1211
|
+
// Automatically call API when selection state changes
|
|
1212
|
+
this.initializeSelectionWatcher();
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Initialize watcher for selection state changes
|
|
1216
|
+
*/
|
|
1217
|
+
initializeSelectionWatcher() {
|
|
1218
|
+
// Combine all selection observables and watch for changes
|
|
1219
|
+
combineLatest([
|
|
1220
|
+
this.documentQuery.selectSelectedMenuItem(),
|
|
1221
|
+
this.documentQuery.selectSelectedUserId(),
|
|
1222
|
+
this.documentQuery.selectSelectedStatus()
|
|
1223
|
+
]).pipe(debounceTime(300), // Debounce to avoid too many API calls
|
|
1224
|
+
distinctUntilChanged((prev, curr) => prev[0] === curr[0] && prev[1] === curr[1] && prev[2] === curr[2]), switchMap(([menuItem, userId, status]) => {
|
|
1225
|
+
// Only call API if at least one selection is made
|
|
1226
|
+
if (menuItem || userId || status) {
|
|
1227
|
+
return this.documentHttpService.getDocumentsBySelection(menuItem, userId, status);
|
|
1228
|
+
}
|
|
1229
|
+
return [];
|
|
1230
|
+
})).subscribe({
|
|
1231
|
+
next: (response) => {
|
|
1232
|
+
console.log('API called with selection:', response);
|
|
1233
|
+
},
|
|
1234
|
+
error: (error) => {
|
|
1235
|
+
console.error('Error calling API with selection:', error);
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
899
1239
|
/**
|
|
900
|
-
*
|
|
901
|
-
*
|
|
1240
|
+
* Set the document data
|
|
1241
|
+
* @param document the document data
|
|
902
1242
|
*/
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
/** Number of pending files, sourced from the `SHARED` constants. */
|
|
907
|
-
pendingFileCount = SHARED.PENDINGCOUNT;
|
|
1243
|
+
set(document) {
|
|
1244
|
+
this.documentSubject$.next(document);
|
|
1245
|
+
}
|
|
908
1246
|
/**
|
|
909
|
-
*
|
|
910
|
-
* @
|
|
1247
|
+
* Get the document data
|
|
1248
|
+
* @returns the document data
|
|
911
1249
|
*/
|
|
912
|
-
|
|
913
|
-
this.
|
|
1250
|
+
get() {
|
|
1251
|
+
return this.documentSubject$.asObservable();
|
|
914
1252
|
}
|
|
915
1253
|
/**
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
* If the folder ID is not provided, an empty string is returned.
|
|
919
|
-
* @param {string} folderBlockId - The unique identifier of the folder to filter by.
|
|
920
|
-
* @returns {string} The validated folder ID, or an empty string if the input is invalid.
|
|
1254
|
+
* Set the selected menu item
|
|
1255
|
+
* @param menuItem the selected menu item
|
|
921
1256
|
*/
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1257
|
+
setSelectedMenuItem(menuItem) {
|
|
1258
|
+
this.documentStore.setSelectedMenuItem(menuItem);
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Set the selected user ID
|
|
1262
|
+
* @param userId the selected user ID
|
|
1263
|
+
*/
|
|
1264
|
+
setSelectedUserId(userId) {
|
|
1265
|
+
this.documentStore.setSelectedUserId(userId);
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* Set the selected status
|
|
1269
|
+
* @param status the selected status
|
|
1270
|
+
*/
|
|
1271
|
+
setSelectedStatus(status) {
|
|
1272
|
+
this.documentStore.setSelectedStatus(status);
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Set all selection state at once
|
|
1276
|
+
* @param menuItem the selected menu item
|
|
1277
|
+
* @param userId the selected user ID
|
|
1278
|
+
* @param status the selected status
|
|
1279
|
+
*/
|
|
1280
|
+
setSelectionState(menuItem, userId, status) {
|
|
1281
|
+
this.documentStore.setSelectionState(menuItem, userId, status);
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Clear all selection state
|
|
1285
|
+
*/
|
|
1286
|
+
clearSelectionState() {
|
|
1287
|
+
this.documentStore.clearSelectionState();
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Set user list visibility
|
|
1291
|
+
* @param show whether to show the user list
|
|
1292
|
+
*/
|
|
1293
|
+
setShowUserList(show) {
|
|
1294
|
+
this.documentStore.setShowUserList(show);
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Get the current selection state
|
|
1298
|
+
* @returns observable of the current selection state
|
|
1299
|
+
*/
|
|
1300
|
+
getSelectionState() {
|
|
1301
|
+
return this.documentQuery.selectSelectionState();
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Manually trigger API call with current selection state
|
|
1305
|
+
*/
|
|
1306
|
+
refreshDocumentsWithCurrentSelection() {
|
|
1307
|
+
const currentState = this.documentQuery.getSelectionState();
|
|
1308
|
+
this.documentHttpService.getDocumentsBySelection(currentState.menuItem, currentState.userId, currentState.status).subscribe({
|
|
1309
|
+
next: (response) => {
|
|
1310
|
+
console.log('Manual API refresh:', response);
|
|
1311
|
+
},
|
|
1312
|
+
error: (error) => {
|
|
1313
|
+
console.error('Error in manual API refresh:', error);
|
|
1314
|
+
}
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1318
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, providedIn: 'root' });
|
|
1319
|
+
}
|
|
1320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, decorators: [{
|
|
1321
|
+
type: Injectable,
|
|
1322
|
+
args: [{
|
|
1323
|
+
providedIn: 'root',
|
|
1324
|
+
}]
|
|
1325
|
+
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentHttpService }] });
|
|
1326
|
+
|
|
1327
|
+
class UserListComponent {
|
|
1328
|
+
documentService;
|
|
1329
|
+
documentStore;
|
|
1330
|
+
documentQuery;
|
|
1331
|
+
userData = [];
|
|
1332
|
+
selectedUser;
|
|
1333
|
+
userSelected = new EventEmitter();
|
|
1334
|
+
constructor(documentService, documentStore, documentQuery) {
|
|
1335
|
+
this.documentService = documentService;
|
|
1336
|
+
this.documentStore = documentStore;
|
|
1337
|
+
this.documentQuery = documentQuery;
|
|
1338
|
+
}
|
|
1339
|
+
ngOnInit() {
|
|
1340
|
+
// Initialize user data with persistent colors and initials
|
|
1341
|
+
this.userData = USERLIST.map((user, index) => ({
|
|
1342
|
+
...user,
|
|
1343
|
+
initials: this.getInitials(user.username),
|
|
1344
|
+
color: this.getColorByIndex(index)
|
|
1345
|
+
}));
|
|
1346
|
+
// Subscribe to selected user ID from state
|
|
1347
|
+
this.documentQuery.selectSelectedUserId().subscribe(userId => {
|
|
1348
|
+
if (userId) {
|
|
1349
|
+
const user = this.userData.find(u => u._id === userId);
|
|
1350
|
+
this.selectedUser = user ? user.username : undefined;
|
|
1351
|
+
}
|
|
1352
|
+
else {
|
|
1353
|
+
this.selectedUser = undefined;
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
// Subscribe to user list visibility and reset selection when hidden
|
|
1357
|
+
this.documentQuery.selectShowUserList().subscribe(show => {
|
|
1358
|
+
if (!show && this.selectedUser) {
|
|
1359
|
+
// Reset user selection when user list is hidden
|
|
1360
|
+
this.selectedUser = undefined;
|
|
1361
|
+
this.userSelected.emit('');
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
getInitials(username) {
|
|
1366
|
+
return username.split(' ').map(name => name.charAt(0)).join('').toUpperCase();
|
|
1367
|
+
}
|
|
1368
|
+
getColorByIndex(index) {
|
|
1369
|
+
const colors = ['orange', 'blue', 'green', 'grey', 'purple'];
|
|
1370
|
+
return colors[index % colors.length];
|
|
1371
|
+
}
|
|
1372
|
+
getColorValue(colorName) {
|
|
1373
|
+
const colorMap = {
|
|
1374
|
+
'orange': '#f97316',
|
|
1375
|
+
'blue': '#3b82f6',
|
|
1376
|
+
'green': '#10b981',
|
|
1377
|
+
'grey': '#6b7280',
|
|
1378
|
+
'purple': '#8b5cf6'
|
|
1379
|
+
};
|
|
1380
|
+
return colorMap[colorName] || '#3b82f6';
|
|
1381
|
+
}
|
|
1382
|
+
onUserSelect(username, id) {
|
|
1383
|
+
// If the same user is clicked again, unselect it
|
|
1384
|
+
if (this.selectedUser === username) {
|
|
1385
|
+
this.selectedUser = undefined;
|
|
1386
|
+
this.documentStore.setSelectedUserId(null);
|
|
1387
|
+
this.userSelected.emit('');
|
|
1388
|
+
}
|
|
1389
|
+
else {
|
|
1390
|
+
// Select the new user
|
|
1391
|
+
this.selectedUser = username;
|
|
1392
|
+
this.documentStore.setSelectedUserId(id);
|
|
1393
|
+
this.userSelected.emit(username);
|
|
925
1394
|
}
|
|
926
|
-
this.documentStore.setParentDocumentTypeId(folderBlockId);
|
|
927
|
-
return folderBlockId;
|
|
928
1395
|
}
|
|
929
|
-
|
|
930
|
-
|
|
1396
|
+
// Method to programmatically select a user
|
|
1397
|
+
selectUser(userId) {
|
|
1398
|
+
const user = this.userData.find(u => u._id === userId);
|
|
1399
|
+
if (user) {
|
|
1400
|
+
this.selectedUser = user.username;
|
|
1401
|
+
this.documentStore.setSelectedUserId(userId);
|
|
1402
|
+
this.userSelected.emit(user.username);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
// Method to programmatically unselect user
|
|
1406
|
+
unselectUser() {
|
|
1407
|
+
this.selectedUser = undefined;
|
|
1408
|
+
this.documentStore.setSelectedUserId(null);
|
|
1409
|
+
this.userSelected.emit('');
|
|
1410
|
+
}
|
|
1411
|
+
// Method to check if a user is selected
|
|
1412
|
+
isUserSelected(userId) {
|
|
1413
|
+
return this.selectedUser === this.userData.find(u => u._id === userId)?.username;
|
|
1414
|
+
}
|
|
1415
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UserListComponent, deps: [{ token: DocumentService }, { token: DocumentStore }, { token: DocumentQuery }], target: i0.ɵɵFactoryTarget.Component });
|
|
1416
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: UserListComponent, isStandalone: false, selector: "lib-user-list", outputs: { userSelected: "userSelected" }, ngImport: i0, template: "<div class=\"user-list-container\">\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of userData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.username\"\r\n [style.border-color]=\"selectedUser === user.username ? getColorValue(user.color) : 'transparent'\"\r\n (click)=\"onUserSelect(user.username, 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.username }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approveDocumentCount }} approved / {{ user.pendingDocumentCount }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.username\">\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem;animation:slideInFromTop .3s ease-out}@keyframes slideInFromTop{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.user-cards{display:flex;flex-wrap:wrap;gap:1rem}.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;animation:fadeIn .2s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
931
1417
|
}
|
|
932
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type:
|
|
1418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UserListComponent, decorators: [{
|
|
933
1419
|
type: Component,
|
|
934
|
-
args: [{ selector: 'lib-
|
|
935
|
-
}], ctorParameters: () => [{ type: DocumentStore }], propDecorators: {
|
|
936
|
-
type:
|
|
1420
|
+
args: [{ selector: 'lib-user-list', standalone: false, template: "<div class=\"user-list-container\">\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of userData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.username\"\r\n [style.border-color]=\"selectedUser === user.username ? getColorValue(user.color) : 'transparent'\"\r\n (click)=\"onUserSelect(user.username, 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.username }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approveDocumentCount }} approved / {{ user.pendingDocumentCount }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.username\">\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem;animation:slideInFromTop .3s ease-out}@keyframes slideInFromTop{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.user-cards{display:flex;flex-wrap:wrap;gap:1rem}.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;animation:fadeIn .2s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}\n"] }]
|
|
1421
|
+
}], ctorParameters: () => [{ type: DocumentService }, { type: DocumentStore }, { type: DocumentQuery }], propDecorators: { userSelected: [{
|
|
1422
|
+
type: Output
|
|
937
1423
|
}] } });
|
|
938
1424
|
|
|
1425
|
+
class DocumentStatusComponent {
|
|
1426
|
+
documentStore;
|
|
1427
|
+
documentQuery;
|
|
1428
|
+
documentService;
|
|
1429
|
+
statusData = SAMPLE_STATUS_DATA;
|
|
1430
|
+
selectedStatus = null;
|
|
1431
|
+
subscription = new Subscription();
|
|
1432
|
+
constructor(documentStore, documentQuery, documentService) {
|
|
1433
|
+
this.documentStore = documentStore;
|
|
1434
|
+
this.documentQuery = documentQuery;
|
|
1435
|
+
this.documentService = documentService;
|
|
1436
|
+
}
|
|
1437
|
+
ngOnInit() {
|
|
1438
|
+
// Subscribe to the selected status from the store
|
|
1439
|
+
this.subscription.add(this.documentQuery.selectSelectedStatus().subscribe(status => {
|
|
1440
|
+
this.selectedStatus = status;
|
|
1441
|
+
console.log('Status selection changed:', status);
|
|
1442
|
+
}));
|
|
1443
|
+
// Subscribe to all selection state changes
|
|
1444
|
+
this.subscription.add(this.documentService.getSelectionState().subscribe(selectionState => {
|
|
1445
|
+
console.log('Current selection state:', selectionState);
|
|
1446
|
+
}));
|
|
1447
|
+
}
|
|
1448
|
+
ngOnDestroy() {
|
|
1449
|
+
this.subscription.unsubscribe();
|
|
1450
|
+
}
|
|
1451
|
+
getTotalCount() {
|
|
1452
|
+
return this.statusData.reduce((total, status) => total + (status.count ?? 0), 0);
|
|
1453
|
+
}
|
|
1454
|
+
getPercentage(count) {
|
|
1455
|
+
const total = this.getTotalCount();
|
|
1456
|
+
return total > 0 ? (count / total) * 100 : 0;
|
|
1457
|
+
}
|
|
1458
|
+
selectStatus(status) {
|
|
1459
|
+
const newStatus = this.selectedStatus === status ? null : status;
|
|
1460
|
+
this.documentService.setSelectedStatus(newStatus);
|
|
1461
|
+
}
|
|
1462
|
+
isSelected(status) {
|
|
1463
|
+
const isSelected = this.selectedStatus === status;
|
|
1464
|
+
return isSelected;
|
|
1465
|
+
}
|
|
1466
|
+
// Example method to demonstrate setting other selection properties
|
|
1467
|
+
setExampleSelections() {
|
|
1468
|
+
// This is just for demonstration - in real usage, these would come from user interactions
|
|
1469
|
+
this.documentService.setSelectionState('Identity', 'user123', 'Approved');
|
|
1470
|
+
}
|
|
1471
|
+
clearAllSelections() {
|
|
1472
|
+
this.documentService.clearSelectionState();
|
|
1473
|
+
}
|
|
1474
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStatusComponent, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1475
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentStatusComponent, isStandalone: false, selector: "lib-document-status", ngImport: i0, template: "<div class=\"status-summary-container\">\n <div class=\"status-cards\">\n \n <div \n *ngFor=\"let status of statusData\" \n class=\"status-card\"\n [ngClass]=\"status.status ? 'status-' + status.status.toLowerCase() : ''\"\n [class.selected]=\"isSelected(status.status || '')\"\n (click)=\"selectStatus(status.status || '')\"\n >\n <div class=\"status-icon\" [ngClass]=\"'icon-' + status?.status?.toLowerCase()\">\n <i [class]=\"status.icon\"></i>\n </div>\n <div class=\"status-info\">\n <div class=\"status-count\">{{ status.count }}</div>\n <div class=\"status-name\">{{ status.status }}</div>\n \n </div>\n </div>\n </div>\n \n <div class=\"progress-bar-container\">\n <div class=\"progress-bar\">\n <div \n *ngFor=\"let status of statusData\" \n class=\"progress-segment\"\n [style.width.%]=\"getPercentage(status.count ?? 0)\"\n [style.background-color]=\"status.color\"\n ></div>\n </div>\n </div>\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: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1476
|
+
}
|
|
1477
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStatusComponent, decorators: [{
|
|
1478
|
+
type: Component,
|
|
1479
|
+
args: [{ selector: 'lib-document-status', standalone: false, template: "<div class=\"status-summary-container\">\n <div class=\"status-cards\">\n \n <div \n *ngFor=\"let status of statusData\" \n class=\"status-card\"\n [ngClass]=\"status.status ? 'status-' + status.status.toLowerCase() : ''\"\n [class.selected]=\"isSelected(status.status || '')\"\n (click)=\"selectStatus(status.status || '')\"\n >\n <div class=\"status-icon\" [ngClass]=\"'icon-' + status?.status?.toLowerCase()\">\n <i [class]=\"status.icon\"></i>\n </div>\n <div class=\"status-info\">\n <div class=\"status-count\">{{ status.count }}</div>\n <div class=\"status-name\">{{ status.status }}</div>\n \n </div>\n </div>\n </div>\n \n <div class=\"progress-bar-container\">\n <div class=\"progress-bar\">\n <div \n *ngFor=\"let status of statusData\" \n class=\"progress-segment\"\n [style.width.%]=\"getPercentage(status.count ?? 0)\"\n [style.background-color]=\"status.color\"\n ></div>\n </div>\n </div>\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"] }]
|
|
1480
|
+
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentService }] });
|
|
1481
|
+
|
|
939
1482
|
/**
|
|
940
1483
|
* The `FolderContainerComponent` is responsible for rendering a container
|
|
941
1484
|
* that displays a list of documents and associated folder panel data.
|
|
@@ -944,6 +1487,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
944
1487
|
* and accepts a document list input of type `DocumentModel`.
|
|
945
1488
|
*/
|
|
946
1489
|
class FolderContainerComponent {
|
|
1490
|
+
documentQuery;
|
|
947
1491
|
/**
|
|
948
1492
|
* A list of documents passed as input to the component.
|
|
949
1493
|
* Represents the document data to be displayed in the folder container.
|
|
@@ -959,13 +1503,78 @@ class FolderContainerComponent {
|
|
|
959
1503
|
* @type {string}
|
|
960
1504
|
*/
|
|
961
1505
|
contextId = SHARED.EMPTY;
|
|
962
|
-
|
|
963
|
-
|
|
1506
|
+
/**
|
|
1507
|
+
* Flag to control user list visibility
|
|
1508
|
+
*/
|
|
1509
|
+
showUserList = true;
|
|
1510
|
+
constructor(documentQuery) {
|
|
1511
|
+
this.documentQuery = documentQuery;
|
|
1512
|
+
}
|
|
1513
|
+
ngOnInit() {
|
|
1514
|
+
// Subscribe to user list visibility state
|
|
1515
|
+
this.documentQuery.selectShowUserList().subscribe(show => {
|
|
1516
|
+
this.showUserList = show;
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Get the animation state for the user list
|
|
1521
|
+
*/
|
|
1522
|
+
getUserListAnimationState() {
|
|
1523
|
+
return this.showUserList ? 'visible' : 'hidden';
|
|
1524
|
+
}
|
|
1525
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderContainerComponent, deps: [{ token: DocumentQuery }], target: i0.ɵɵFactoryTarget.Component });
|
|
1526
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId" }, ngImport: i0, template: "\r\n<!-- <lib-folder-block [folderList]=\"folderList\"></lib-folder-block> -->\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"getUserListAnimationState()\">\r\n <lib-user-list></lib-user-list>\r\n</div>\r\n<lib-document-status></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", outputs: ["userSelected"] }, { kind: "component", type: DocumentStatusComponent, selector: "lib-document-status" }], animations: [
|
|
1527
|
+
trigger('slideInOut', [
|
|
1528
|
+
state('visible', style({
|
|
1529
|
+
maxHeight: '600px',
|
|
1530
|
+
opacity: 1,
|
|
1531
|
+
transform: 'translateY(0)',
|
|
1532
|
+
overflow: 'hidden',
|
|
1533
|
+
marginBottom: '1rem'
|
|
1534
|
+
})),
|
|
1535
|
+
state('hidden', style({
|
|
1536
|
+
maxHeight: '0px',
|
|
1537
|
+
opacity: 0,
|
|
1538
|
+
transform: 'translateY(-30px)',
|
|
1539
|
+
overflow: 'hidden',
|
|
1540
|
+
marginBottom: '0px'
|
|
1541
|
+
})),
|
|
1542
|
+
transition('visible => hidden', [
|
|
1543
|
+
animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
|
|
1544
|
+
]),
|
|
1545
|
+
transition('hidden => visible', [
|
|
1546
|
+
animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
|
|
1547
|
+
])
|
|
1548
|
+
])
|
|
1549
|
+
] });
|
|
964
1550
|
}
|
|
965
1551
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderContainerComponent, decorators: [{
|
|
966
1552
|
type: Component,
|
|
967
|
-
args: [{ selector: 'lib-folder-container', standalone: false,
|
|
968
|
-
|
|
1553
|
+
args: [{ selector: 'lib-folder-container', standalone: false, animations: [
|
|
1554
|
+
trigger('slideInOut', [
|
|
1555
|
+
state('visible', style({
|
|
1556
|
+
maxHeight: '600px',
|
|
1557
|
+
opacity: 1,
|
|
1558
|
+
transform: 'translateY(0)',
|
|
1559
|
+
overflow: 'hidden',
|
|
1560
|
+
marginBottom: '1rem'
|
|
1561
|
+
})),
|
|
1562
|
+
state('hidden', style({
|
|
1563
|
+
maxHeight: '0px',
|
|
1564
|
+
opacity: 0,
|
|
1565
|
+
transform: 'translateY(-30px)',
|
|
1566
|
+
overflow: 'hidden',
|
|
1567
|
+
marginBottom: '0px'
|
|
1568
|
+
})),
|
|
1569
|
+
transition('visible => hidden', [
|
|
1570
|
+
animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
|
|
1571
|
+
]),
|
|
1572
|
+
transition('hidden => visible', [
|
|
1573
|
+
animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
|
|
1574
|
+
])
|
|
1575
|
+
])
|
|
1576
|
+
], template: "\r\n<!-- <lib-folder-block [folderList]=\"folderList\"></lib-folder-block> -->\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"getUserListAnimationState()\">\r\n <lib-user-list></lib-user-list>\r\n</div>\r\n<lib-document-status></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"] }]
|
|
1577
|
+
}], ctorParameters: () => [{ type: DocumentQuery }], propDecorators: { documentList: [{
|
|
969
1578
|
type: Input
|
|
970
1579
|
}], folderList: [{
|
|
971
1580
|
type: Input
|
|
@@ -1111,43 +1720,204 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1111
1720
|
}]
|
|
1112
1721
|
}], ctorParameters: () => [{ type: DocumentService$1 }, { type: DocumentStore }, { type: i3.MessageService }] });
|
|
1113
1722
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
*
|
|
1117
|
-
* This component displays individual document items within a list.
|
|
1118
|
-
* It accepts a list of documents as input and handles interactions with documents.
|
|
1119
|
-
*/
|
|
1120
|
-
class DocumentListItemComponent {
|
|
1723
|
+
class DocumentTableBuilderService {
|
|
1724
|
+
constructor() { }
|
|
1121
1725
|
/**
|
|
1122
|
-
*
|
|
1123
|
-
* @
|
|
1726
|
+
* Builds table data for document sections
|
|
1727
|
+
* @param sections Array of document sections
|
|
1728
|
+
* @returns Array of TableData objects
|
|
1124
1729
|
*/
|
|
1125
|
-
|
|
1730
|
+
buildDocumentSectionsTables(sections) {
|
|
1731
|
+
return sections.map(section => this.buildTableForSection(section));
|
|
1732
|
+
}
|
|
1126
1733
|
/**
|
|
1127
|
-
*
|
|
1128
|
-
* @
|
|
1734
|
+
* Builds table data for a single document section
|
|
1735
|
+
* @param section Document section
|
|
1736
|
+
* @returns TableData object
|
|
1129
1737
|
*/
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1738
|
+
buildTableForSection(section) {
|
|
1739
|
+
const columns = [
|
|
1740
|
+
{
|
|
1741
|
+
field: 'documentName',
|
|
1742
|
+
header: 'Document',
|
|
1743
|
+
type: 'document',
|
|
1744
|
+
width: '35%'
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
field: 'status',
|
|
1748
|
+
header: 'Status',
|
|
1749
|
+
type: 'status',
|
|
1750
|
+
width: '15%'
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
field: 'applicantName',
|
|
1754
|
+
header: 'Applicant',
|
|
1755
|
+
type: 'text',
|
|
1756
|
+
width: '20%'
|
|
1757
|
+
},
|
|
1758
|
+
{
|
|
1759
|
+
field: 'uploadedTime',
|
|
1760
|
+
header: 'Uploaded',
|
|
1761
|
+
type: 'text',
|
|
1762
|
+
width: '15%'
|
|
1763
|
+
},
|
|
1764
|
+
{
|
|
1765
|
+
field: 'actions',
|
|
1766
|
+
header: 'Actions',
|
|
1767
|
+
type: 'actions',
|
|
1768
|
+
width: '15%'
|
|
1769
|
+
}
|
|
1770
|
+
];
|
|
1771
|
+
return {
|
|
1772
|
+
columns: columns,
|
|
1773
|
+
data: section.list
|
|
1774
|
+
};
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* Builds a single table from document list
|
|
1778
|
+
* @param documents Array of document items
|
|
1779
|
+
* @returns TableData object
|
|
1134
1780
|
*/
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1781
|
+
buildDocumentTable(documents) {
|
|
1782
|
+
const columns = [
|
|
1783
|
+
{
|
|
1784
|
+
field: 'documentName',
|
|
1785
|
+
header: 'Document',
|
|
1786
|
+
type: 'document',
|
|
1787
|
+
width: '35%'
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
field: 'status',
|
|
1791
|
+
header: 'Status',
|
|
1792
|
+
type: 'status',
|
|
1793
|
+
width: '15%'
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
field: 'applicantName',
|
|
1797
|
+
header: 'Applicant',
|
|
1798
|
+
type: 'text',
|
|
1799
|
+
width: '20%'
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
field: 'uploadedTime',
|
|
1803
|
+
header: 'Uploaded',
|
|
1804
|
+
type: 'text',
|
|
1805
|
+
width: '15%'
|
|
1806
|
+
},
|
|
1807
|
+
{
|
|
1808
|
+
field: 'actions',
|
|
1809
|
+
header: 'Actions',
|
|
1810
|
+
type: 'actions',
|
|
1811
|
+
width: '15%'
|
|
1812
|
+
}
|
|
1813
|
+
];
|
|
1814
|
+
return {
|
|
1815
|
+
columns: columns,
|
|
1816
|
+
data: documents
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
/**
|
|
1820
|
+
* Gets completion count for a section
|
|
1821
|
+
* @param section Document section
|
|
1822
|
+
* @returns Completion string (e.g., "2/4")
|
|
1823
|
+
*/
|
|
1824
|
+
getCompletionCount(section) {
|
|
1825
|
+
const total = section.list.length;
|
|
1826
|
+
const completed = section.list.filter(doc => doc.status.toLowerCase() === 'approved' ||
|
|
1827
|
+
doc.status.toLowerCase() === 'uploaded').length;
|
|
1828
|
+
return `${completed}/${total}`;
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Transforms document model to document item
|
|
1832
|
+
* @param documents Array of DocumentModel
|
|
1833
|
+
* @returns Array of DocumentItem
|
|
1834
|
+
*/
|
|
1835
|
+
transformDocumentModelToItem(documents) {
|
|
1836
|
+
return documents.map(doc => ({
|
|
1837
|
+
documentName: doc.fileName || doc.documentName || '',
|
|
1838
|
+
documentType: doc.documentType || doc.type || '',
|
|
1839
|
+
documentUrl: doc.documentUrl || doc.url || '',
|
|
1840
|
+
status: doc.status || 'Pending',
|
|
1841
|
+
applicantName: doc.applicantName || doc.applicant || '',
|
|
1842
|
+
uploadedTime: doc.uploadedTime || doc.uploadDate || ''
|
|
1843
|
+
}));
|
|
1844
|
+
}
|
|
1845
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentTableBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1846
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentTableBuilderService, providedIn: 'root' });
|
|
1847
|
+
}
|
|
1848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentTableBuilderService, decorators: [{
|
|
1849
|
+
type: Injectable,
|
|
1850
|
+
args: [{
|
|
1851
|
+
providedIn: 'root'
|
|
1852
|
+
}]
|
|
1853
|
+
}], ctorParameters: () => [] });
|
|
1854
|
+
|
|
1855
|
+
class TablePrimaryComponent {
|
|
1856
|
+
tableData = { columns: [], data: [] };
|
|
1857
|
+
showHeader = true;
|
|
1858
|
+
tableStyle = { 'min-width': '100%' };
|
|
1859
|
+
// Helper methods for document table
|
|
1860
|
+
getStatusClass(status) {
|
|
1861
|
+
switch (status.toLowerCase()) {
|
|
1862
|
+
case 'pending':
|
|
1863
|
+
return 'status-pending';
|
|
1864
|
+
case 'approved':
|
|
1865
|
+
return 'status-approved';
|
|
1866
|
+
case 'alert':
|
|
1867
|
+
return 'status-alert';
|
|
1868
|
+
case 'uploaded':
|
|
1869
|
+
return 'status-uploaded';
|
|
1870
|
+
case 'reviewing':
|
|
1871
|
+
return 'status-reviewing';
|
|
1872
|
+
case 'rejected':
|
|
1873
|
+
return 'status-rejected';
|
|
1874
|
+
default:
|
|
1875
|
+
return 'status-pending';
|
|
1139
1876
|
}
|
|
1140
|
-
this.documentClick.emit(document);
|
|
1141
1877
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1878
|
+
getStatusIcon(status) {
|
|
1879
|
+
switch (status.toLowerCase()) {
|
|
1880
|
+
case 'pending':
|
|
1881
|
+
return 'pi pi-clock';
|
|
1882
|
+
case 'approved':
|
|
1883
|
+
return 'pi pi-check';
|
|
1884
|
+
case 'alert':
|
|
1885
|
+
return 'pi pi-exclamation-triangle';
|
|
1886
|
+
case 'uploaded':
|
|
1887
|
+
return 'pi pi-cloud-upload';
|
|
1888
|
+
case 'reviewing':
|
|
1889
|
+
return 'pi pi-eye';
|
|
1890
|
+
case 'rejected':
|
|
1891
|
+
return 'pi pi-times';
|
|
1892
|
+
default:
|
|
1893
|
+
return 'pi pi-clock';
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
getFileSize(fileName) {
|
|
1897
|
+
// Mock file size calculation - in real app, this would come from the document data
|
|
1898
|
+
const sizes = ['2.4 MB', '1.8 MB', '3.2 MB', '1.1 MB', '4.5 MB', '2.1 MB'];
|
|
1899
|
+
const randomIndex = Math.floor(Math.random() * sizes.length);
|
|
1900
|
+
return sizes[randomIndex];
|
|
1901
|
+
}
|
|
1902
|
+
getFileExtension(fileName) {
|
|
1903
|
+
return fileName.split('.').pop()?.toUpperCase() || 'PDF';
|
|
1904
|
+
}
|
|
1905
|
+
onActionClick(event, rowData) {
|
|
1906
|
+
event.stopPropagation();
|
|
1907
|
+
// Handle action menu click - can be extended with menu functionality
|
|
1908
|
+
console.log('Action clicked for document:', rowData);
|
|
1909
|
+
}
|
|
1910
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TablePrimaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1911
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: TablePrimaryComponent, isStandalone: false, selector: "lib-table-primary", inputs: { tableData: "tableData", showHeader: "showHeader", tableStyle: "tableStyle" }, ngImport: i0, template: "<div class=\"card\">\r\n <p-table [value]=\"tableData.data\" [tableStyle]=\"tableStyle\">\r\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\r\n <tr>\r\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n {{ col.header }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n <!-- Document Cell -->\r\n <div *ngIf=\"col.type === 'document'\" class=\"document-cell\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file-pdf\" *ngIf=\"getFileExtension(rowData[col.field]) === 'PDF'\"></i>\r\n <i class=\"pi pi-image\" *ngIf=\"getFileExtension(rowData[col.field]) === 'JPG' || getFileExtension(rowData[col.field]) === 'PNG'\"></i>\r\n <i class=\"pi pi-file-excel\" *ngIf=\"getFileExtension(rowData[col.field]) === 'XLSX'\"></i>\r\n <i class=\"pi pi-file\" *ngIf=\"getFileExtension(rowData[col.field]) !== 'PDF' && getFileExtension(rowData[col.field]) !== 'JPG' && getFileExtension(rowData[col.field]) !== 'PNG' && getFileExtension(rowData[col.field]) !== 'XLSX'\"></i>\r\n </div>\r\n <div class=\"document-details\">\r\n <div class=\"document-name\">{{ rowData.documentType }}</div>\r\n <div class=\"file-info\">{{ rowData[col.field] }} - {{ getFileSize(rowData[col.field]) }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Status Cell -->\r\n <div *ngIf=\"col.type === 'status'\" class=\"status-cell\">\r\n <span class=\"status-pill\" [ngClass]=\"getStatusClass(rowData[col.field])\">\r\n <i [class]=\"getStatusIcon(rowData[col.field])\"></i>\r\n {{ rowData[col.field] }}\r\n </span>\r\n </div>\r\n\r\n <!-- Actions Cell -->\r\n <div *ngIf=\"col.type === 'actions'\" class=\"actions-cell\">\r\n <button pButton pRipple type=\"button\" icon=\"ri-delete-bin-6-line\" \r\n class=\"p-button-text p-button-rounded\" \r\n (click)=\"onActionClick($event, rowData)\">\r\n </button>\r\n </div>\r\n\r\n <!-- Default Text Cell -->\r\n <div *ngIf=\"!col.type || col.type === 'text'\" class=\"text-cell\">\r\n {{ rowData[col.field] }}\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\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}::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: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.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.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: "directive", type: i5.Ripple, selector: "[pRipple]" }] });
|
|
1144
1912
|
}
|
|
1145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type:
|
|
1913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TablePrimaryComponent, decorators: [{
|
|
1146
1914
|
type: Component,
|
|
1147
|
-
args: [{ selector: 'lib-
|
|
1148
|
-
}], propDecorators: {
|
|
1149
|
-
type:
|
|
1150
|
-
}],
|
|
1915
|
+
args: [{ selector: 'lib-table-primary', standalone: false, template: "<div class=\"card\">\r\n <p-table [value]=\"tableData.data\" [tableStyle]=\"tableStyle\">\r\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\r\n <tr>\r\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n {{ col.header }}\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\r\n <!-- Document Cell -->\r\n <div *ngIf=\"col.type === 'document'\" class=\"document-cell\">\r\n <div class=\"document-info\">\r\n <div class=\"document-icon\">\r\n <i class=\"pi pi-file-pdf\" *ngIf=\"getFileExtension(rowData[col.field]) === 'PDF'\"></i>\r\n <i class=\"pi pi-image\" *ngIf=\"getFileExtension(rowData[col.field]) === 'JPG' || getFileExtension(rowData[col.field]) === 'PNG'\"></i>\r\n <i class=\"pi pi-file-excel\" *ngIf=\"getFileExtension(rowData[col.field]) === 'XLSX'\"></i>\r\n <i class=\"pi pi-file\" *ngIf=\"getFileExtension(rowData[col.field]) !== 'PDF' && getFileExtension(rowData[col.field]) !== 'JPG' && getFileExtension(rowData[col.field]) !== 'PNG' && getFileExtension(rowData[col.field]) !== 'XLSX'\"></i>\r\n </div>\r\n <div class=\"document-details\">\r\n <div class=\"document-name\">{{ rowData.documentType }}</div>\r\n <div class=\"file-info\">{{ rowData[col.field] }} - {{ getFileSize(rowData[col.field]) }}</div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Status Cell -->\r\n <div *ngIf=\"col.type === 'status'\" class=\"status-cell\">\r\n <span class=\"status-pill\" [ngClass]=\"getStatusClass(rowData[col.field])\">\r\n <i [class]=\"getStatusIcon(rowData[col.field])\"></i>\r\n {{ rowData[col.field] }}\r\n </span>\r\n </div>\r\n\r\n <!-- Actions Cell -->\r\n <div *ngIf=\"col.type === 'actions'\" class=\"actions-cell\">\r\n <button pButton pRipple type=\"button\" icon=\"ri-delete-bin-6-line\" \r\n class=\"p-button-text p-button-rounded\" \r\n (click)=\"onActionClick($event, rowData)\">\r\n </button>\r\n </div>\r\n\r\n <!-- Default Text Cell -->\r\n <div *ngIf=\"!col.type || col.type === 'text'\" class=\"text-cell\">\r\n {{ rowData[col.field] }}\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\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}::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"] }]
|
|
1916
|
+
}], propDecorators: { tableData: [{
|
|
1917
|
+
type: Input
|
|
1918
|
+
}], showHeader: [{
|
|
1919
|
+
type: Input
|
|
1920
|
+
}], tableStyle: [{
|
|
1151
1921
|
type: Input
|
|
1152
1922
|
}] } });
|
|
1153
1923
|
|
|
@@ -1334,7 +2104,7 @@ class DocumentUploadComponent {
|
|
|
1334
2104
|
this.fileUploader.choose();
|
|
1335
2105
|
}
|
|
1336
2106
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentUploadService }, { token: DocumentService$1 }, { token: i3.PrimeNGConfig }, { token: FileFormatService }, { token: i3.MessageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1337
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", 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:
|
|
2107
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", 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: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { 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: 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$1.ProgressBar, selector: "p-progressBar", inputs: ["value", "showValue", "styleClass", "style", "unit", "mode", "color"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1338
2108
|
}
|
|
1339
2109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, decorators: [{
|
|
1340
2110
|
type: Component,
|
|
@@ -1346,35 +2116,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1346
2116
|
args: ['fileUploader']
|
|
1347
2117
|
}] } });
|
|
1348
2118
|
|
|
1349
|
-
/**
|
|
1350
|
-
* Service to manage the document data
|
|
1351
|
-
*/
|
|
1352
|
-
class DocumentService {
|
|
1353
|
-
documentSubject$ = new BehaviorSubject(null);
|
|
1354
|
-
/**
|
|
1355
|
-
* Set the document data
|
|
1356
|
-
* @param document the document data
|
|
1357
|
-
*/
|
|
1358
|
-
set(document) {
|
|
1359
|
-
this.documentSubject$.next(document);
|
|
1360
|
-
}
|
|
1361
|
-
/**
|
|
1362
|
-
* Get the document data
|
|
1363
|
-
* @returns the document data
|
|
1364
|
-
*/
|
|
1365
|
-
get() {
|
|
1366
|
-
return this.documentSubject$.asObservable();
|
|
1367
|
-
}
|
|
1368
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1369
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, providedIn: 'root' });
|
|
1370
|
-
}
|
|
1371
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, decorators: [{
|
|
1372
|
-
type: Injectable,
|
|
1373
|
-
args: [{
|
|
1374
|
-
providedIn: 'root',
|
|
1375
|
-
}]
|
|
1376
|
-
}] });
|
|
1377
|
-
|
|
1378
2119
|
/**
|
|
1379
2120
|
* Description placeholder
|
|
1380
2121
|
* @class LinkedDocumentComponent
|
|
@@ -1503,7 +2244,7 @@ class DocumentViewerComponent {
|
|
|
1503
2244
|
this.subscription.unsubscribe();
|
|
1504
2245
|
}
|
|
1505
2246
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1506
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument", documentList: "documentList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }@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 <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:
|
|
2247
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument", documentList: "documentList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }@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 <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: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4$1.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: LinkedDocumentComponent, selector: "app-linked-document", inputs: ["selectedDocument", "documentList"], outputs: ["selectedDocumentChange"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1507
2248
|
}
|
|
1508
2249
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, decorators: [{
|
|
1509
2250
|
type: Component,
|
|
@@ -1514,146 +2255,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1514
2255
|
type: Input
|
|
1515
2256
|
}] } });
|
|
1516
2257
|
|
|
1517
|
-
/**
|
|
1518
|
-
* Service for managing user session details.
|
|
1519
|
-
* @class SessionService
|
|
1520
|
-
* @typedef {SessionService}
|
|
1521
|
-
*/
|
|
1522
|
-
class SessionService {
|
|
1523
|
-
router;
|
|
1524
|
-
/**
|
|
1525
|
-
* Creates an instance of SessionService.
|
|
1526
|
-
* @param {Router} router - Angular Router for navigation.
|
|
1527
|
-
*/
|
|
1528
|
-
constructor(router) {
|
|
1529
|
-
this.router = router;
|
|
1530
|
-
}
|
|
1531
|
-
/**
|
|
1532
|
-
* Retrieves the current user's role from local storage.
|
|
1533
|
-
* @returns {string | null} The user's role, or null if not found.
|
|
1534
|
-
*/
|
|
1535
|
-
getUserRole() {
|
|
1536
|
-
return localStorage.getItem('role');
|
|
1537
|
-
}
|
|
1538
|
-
/**
|
|
1539
|
-
* Stores the user session data in local storage.
|
|
1540
|
-
* @param {any} data - The session data to store.
|
|
1541
|
-
*/
|
|
1542
|
-
setUserSession(data) {
|
|
1543
|
-
localStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
|
|
1544
|
-
}
|
|
1545
|
-
/**
|
|
1546
|
-
* Retrieves the stored user session data.
|
|
1547
|
-
* @returns {any | null} The parsed session data, or null if not found.
|
|
1548
|
-
*/
|
|
1549
|
-
getUserSession() {
|
|
1550
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
1551
|
-
return sessionData ? JSON.parse(sessionData) : null;
|
|
1552
|
-
}
|
|
1553
|
-
/**
|
|
1554
|
-
* Retrieves the user's permissions from the stored session data.
|
|
1555
|
-
* @returns {any | null} The user's permissions, or null if not found.
|
|
1556
|
-
*/
|
|
1557
|
-
getUserPermissions() {
|
|
1558
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
1559
|
-
return sessionData ? JSON.parse(sessionData).permissions : null;
|
|
1560
|
-
}
|
|
1561
|
-
/**
|
|
1562
|
-
* Retrieves the session ID from the stored session data.
|
|
1563
|
-
* @returns {any | null} The session ID, or null if not found.
|
|
1564
|
-
*/
|
|
1565
|
-
getSessionID() {
|
|
1566
|
-
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
1567
|
-
console.log(sessionData);
|
|
1568
|
-
if (sessionData) {
|
|
1569
|
-
const sessionId = JSON.parse(sessionData);
|
|
1570
|
-
console.log(sessionId);
|
|
1571
|
-
return sessionId;
|
|
1572
|
-
}
|
|
1573
|
-
return null;
|
|
1574
|
-
}
|
|
1575
|
-
/**
|
|
1576
|
-
* Clears all stored session data from local storage.
|
|
1577
|
-
*/
|
|
1578
|
-
clearSession() {
|
|
1579
|
-
localStorage.clear();
|
|
1580
|
-
}
|
|
1581
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1582
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
1583
|
-
}
|
|
1584
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, decorators: [{
|
|
1585
|
-
type: Injectable,
|
|
1586
|
-
args: [{
|
|
1587
|
-
providedIn: 'root'
|
|
1588
|
-
}]
|
|
1589
|
-
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
1590
|
-
|
|
1591
|
-
/**
|
|
1592
|
-
* Directive to conditionally show or hide elements based on user permissions.
|
|
1593
|
-
* @class HasPermissionDirective
|
|
1594
|
-
* @typedef {HasPermissionDirective}
|
|
1595
|
-
*/
|
|
1596
|
-
class HasPermissionDirective {
|
|
1597
|
-
el;
|
|
1598
|
-
renderer;
|
|
1599
|
-
sessionService;
|
|
1600
|
-
/**
|
|
1601
|
-
* The required permission(s) to display the element.
|
|
1602
|
-
* Accepts a single string or an array of strings.
|
|
1603
|
-
* @type {string | string[]}
|
|
1604
|
-
*/
|
|
1605
|
-
permission;
|
|
1606
|
-
/**
|
|
1607
|
-
* Creates an instance of HasPermissionDirective.
|
|
1608
|
-
* @param {ElementRef} el - Reference to the host element.
|
|
1609
|
-
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
1610
|
-
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
1611
|
-
*/
|
|
1612
|
-
constructor(el, renderer, sessionService) {
|
|
1613
|
-
this.el = el;
|
|
1614
|
-
this.renderer = renderer;
|
|
1615
|
-
this.sessionService = sessionService;
|
|
1616
|
-
}
|
|
1617
|
-
/**
|
|
1618
|
-
* Lifecycle hook that is called when input properties change.
|
|
1619
|
-
* @param {SimpleChanges} changes - The changes in input properties.
|
|
1620
|
-
*/
|
|
1621
|
-
ngOnChanges(changes) {
|
|
1622
|
-
if (changes['permission']) {
|
|
1623
|
-
this.checkPermission();
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
/**
|
|
1627
|
-
* Checks if the user has the required permission(s).
|
|
1628
|
-
* Hides the element if the permission is not found.
|
|
1629
|
-
*/
|
|
1630
|
-
checkPermission() {
|
|
1631
|
-
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
1632
|
-
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
1633
|
-
const requiredPermissions = Array.isArray(this.permission)
|
|
1634
|
-
? this.permission
|
|
1635
|
-
: [this.permission];
|
|
1636
|
-
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
1637
|
-
if (!hasPermission) {
|
|
1638
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
1639
|
-
}
|
|
1640
|
-
else {
|
|
1641
|
-
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
1642
|
-
}
|
|
1643
|
-
}
|
|
1644
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1645
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
1646
|
-
}
|
|
1647
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
1648
|
-
type: Directive,
|
|
1649
|
-
args: [{
|
|
1650
|
-
selector: '[permission]',
|
|
1651
|
-
standalone: false
|
|
1652
|
-
}]
|
|
1653
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
1654
|
-
type: Input
|
|
1655
|
-
}] } });
|
|
1656
|
-
|
|
1657
2258
|
/**
|
|
1658
2259
|
* This component is responsible for displaying and managing a list of documents.
|
|
1659
2260
|
* Provides functionality for file upload, document selection, and dialog management.
|
|
@@ -1664,6 +2265,7 @@ class DocumentListComponent {
|
|
|
1664
2265
|
documentHttpService;
|
|
1665
2266
|
documentQuery;
|
|
1666
2267
|
documentStore;
|
|
2268
|
+
documentTableBuilder;
|
|
1667
2269
|
onRefresh = new EventEmitter();
|
|
1668
2270
|
/**
|
|
1669
2271
|
* Represents the context ID for the document list.
|
|
@@ -1743,6 +2345,14 @@ class DocumentListComponent {
|
|
|
1743
2345
|
* @type {string | undefined}
|
|
1744
2346
|
*/
|
|
1745
2347
|
fileName;
|
|
2348
|
+
/**
|
|
2349
|
+
* Document sections data for rendering tables
|
|
2350
|
+
*/
|
|
2351
|
+
documentSections = DUMMY_DOCUMENT_SECTIONS;
|
|
2352
|
+
/**
|
|
2353
|
+
* Table data for each section
|
|
2354
|
+
*/
|
|
2355
|
+
sectionTables = [];
|
|
1746
2356
|
/**
|
|
1747
2357
|
* Creates an instance of DocumentListComponent.
|
|
1748
2358
|
* @class
|
|
@@ -1751,17 +2361,19 @@ class DocumentListComponent {
|
|
|
1751
2361
|
* @param {DocumentQuery} documentQuery - The service responsible for geting stored documents.
|
|
1752
2362
|
* @param {DocumentStore} documentStore - The service responsible for storing documents.
|
|
1753
2363
|
*/
|
|
1754
|
-
constructor(documentUploadService, documentHttpService, documentQuery, documentStore) {
|
|
2364
|
+
constructor(documentUploadService, documentHttpService, documentQuery, documentStore, documentTableBuilder) {
|
|
1755
2365
|
this.documentUploadService = documentUploadService;
|
|
1756
2366
|
this.documentHttpService = documentHttpService;
|
|
1757
2367
|
this.documentQuery = documentQuery;
|
|
1758
2368
|
this.documentStore = documentStore;
|
|
2369
|
+
this.documentTableBuilder = documentTableBuilder;
|
|
1759
2370
|
}
|
|
1760
2371
|
/**
|
|
1761
2372
|
* Initializes the component by fetching the document type list.
|
|
1762
2373
|
*/
|
|
1763
2374
|
ngOnInit() {
|
|
1764
2375
|
this.getDocumentTypeList();
|
|
2376
|
+
this.buildSectionTables();
|
|
1765
2377
|
}
|
|
1766
2378
|
/**
|
|
1767
2379
|
* Handles the click event for file upload.
|
|
@@ -1868,13 +2480,25 @@ class DocumentListComponent {
|
|
|
1868
2480
|
handleOpenSideBar(isVisible) {
|
|
1869
2481
|
this.isSidebarVisible = isVisible;
|
|
1870
2482
|
}
|
|
1871
|
-
|
|
1872
|
-
|
|
2483
|
+
/**
|
|
2484
|
+
* Builds table data for all document sections
|
|
2485
|
+
*/
|
|
2486
|
+
buildSectionTables() {
|
|
2487
|
+
this.sectionTables = this.documentTableBuilder.buildDocumentSectionsTables(this.documentSections);
|
|
2488
|
+
}
|
|
2489
|
+
/**
|
|
2490
|
+
* Gets completion count for a section
|
|
2491
|
+
*/
|
|
2492
|
+
getCompletionCount(section) {
|
|
2493
|
+
return this.documentTableBuilder.getCompletionCount(section);
|
|
2494
|
+
}
|
|
2495
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }, { token: DocumentTableBuilderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2496
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", isUploadButtonVisible: "isUploadButtonVisible", isCollapsed: "isCollapsed", documentList: "documentList" }, outputs: { onRefresh: "onRefresh" }, ngImport: i0, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModal()\"\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\r\n <ng-content></ng-content>\r\n \r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<!-- Document Sections Tables -->\r\n<div class=\"document-sections-container\">\r\n <div class=\"section\" *ngFor=\"let section of documentSections; let i = index\">\r\n <div class=\"section-header\">\r\n <div class=\"section-title\">\r\n <h3>{{ section.header }} Documents</h3>\r\n <p class=\"section-description\">{{ section.description }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ getCompletionCount(section) }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"sectionTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Original Document List (commented out for now) -->\r\n<!--\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion [activeIndex]=\"isCollapsed ? -1 : 0\">\r\n <p-accordionTab class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\"\r\n label=\"Upload File\" style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n-->\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-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-sections-container{padding:.5rem}.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"], dependencies: [{ kind: "directive", type: i4.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"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1873
2497
|
}
|
|
1874
2498
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, decorators: [{
|
|
1875
2499
|
type: Component,
|
|
1876
|
-
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModal()\"\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\r\n <ng-content></ng-content>\r\n \r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion [activeIndex]=\"isCollapsed ? -1 : 0\">\r\n <p-accordionTab class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\"\r\n label=\"Upload File\" style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n<div class=\"grid m-0\">\r\n <div class=\"col-12 p-0\">\r\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\r\n <ng-template pTemplate=\"header\">\r\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <div class=\"side-bar-con\">\r\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"city\">Select Folder</label>\r\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\r\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\r\n <div class=\"bg-gray-100 p-4\">\r\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\r\n [disabled]=\"!selectedOption\">\r\n </p-button>\r\n </div>\r\n </ng-template>\r\n </p-sidebar>\r\n </div>\r\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}\n"] }]
|
|
1877
|
-
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }], propDecorators: { onRefresh: [{
|
|
2500
|
+
args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\r\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" (onHide)=\"handleCloseModal()\"\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\r\n <ng-content></ng-content>\r\n \r\n </document-viewer>\r\n </p-dialog>\r\n</div>\r\n\r\n<!-- Document Sections Tables -->\r\n<div class=\"document-sections-container\">\r\n <div class=\"section\" *ngFor=\"let section of documentSections; let i = index\">\r\n <div class=\"section-header\">\r\n <div class=\"section-title\">\r\n <h3>{{ section.header }} Documents</h3>\r\n <p class=\"section-description\">{{ section.description }}</p>\r\n </div>\r\n <div class=\"completion-status\">\r\n <span class=\"status-badge\">{{ getCompletionCount(section) }} Complete</span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"table-container\">\r\n <lib-table-primary \r\n [tableData]=\"sectionTables[i]\" \r\n [tableStyle]=\"{ 'min-width': '100%' }\">\r\n </lib-table-primary>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Original Document List (commented out for now) -->\r\n<!--\r\n<div class=\"col-12 p-0\">\r\n <div class=\"card p-0 mb-0 document-list-wrapper\">\r\n <p-accordion [activeIndex]=\"isCollapsed ? -1 : 0\">\r\n <p-accordionTab class=\"line-height-2 m-0\">\r\n <ng-template pTemplate=\"header\" let-active=\"active\">\r\n <div class=\"flex align-items-center justify-content-between w-full\">\r\n <span class=\"flex align-items-center gap-2 document-title-wrapper\">\r\n Documents\r\n </span>\r\n @if(isUploadButtonVisible){\r\n <button pButton pRipple class=\"p-button-raised col-3\" [permission]=\"PERMISSION.DOCUMENT_POST\" type=\"button\"\r\n label=\"Upload File\" style=\"border-radius: 10px;\" (click)=\"handleFileUploadClick($event)\"></button>\r\n }\r\n </div>\r\n </ng-template>\r\n @for(document of documentList; track document){\r\n <lib-document-list-item [document]=\"document\"\r\n (documentClick)=\"handleClickForDocument($event)\"></lib-document-list-item>\r\n }\r\n </p-accordionTab>\r\n </p-accordion>\r\n </div>\r\n</div>\r\n-->\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-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-sections-container{padding:.5rem}.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"] }]
|
|
2501
|
+
}], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }, { type: DocumentTableBuilderService }], propDecorators: { onRefresh: [{
|
|
1878
2502
|
type: Output
|
|
1879
2503
|
}], contextId: [{
|
|
1880
2504
|
type: Input
|
|
@@ -1887,15 +2511,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
1887
2511
|
}] } });
|
|
1888
2512
|
|
|
1889
2513
|
class DocumentsMenuComponent {
|
|
2514
|
+
documentStore;
|
|
2515
|
+
documentQuery;
|
|
1890
2516
|
// Get the menu list from container
|
|
1891
|
-
items
|
|
1892
|
-
|
|
1893
|
-
|
|
2517
|
+
items;
|
|
2518
|
+
selectedMenuItem = null;
|
|
2519
|
+
constructor(documentStore, documentQuery) {
|
|
2520
|
+
this.documentStore = documentStore;
|
|
2521
|
+
this.documentQuery = documentQuery;
|
|
2522
|
+
}
|
|
2523
|
+
ngOnInit() {
|
|
2524
|
+
// Subscribe to selected menu item from state
|
|
2525
|
+
this.documentQuery.selectSelectedMenuItem().subscribe(menuItem => {
|
|
2526
|
+
this.selectedMenuItem = menuItem;
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
onMenuItemClick(event, item) {
|
|
2530
|
+
if (this.selectedMenuItem === item.label) {
|
|
2531
|
+
this.selectedMenuItem = null;
|
|
2532
|
+
this.documentStore.setSelectedMenuItem(null);
|
|
2533
|
+
}
|
|
2534
|
+
else {
|
|
2535
|
+
this.selectedMenuItem = item.label;
|
|
2536
|
+
this.documentStore.setSelectedMenuItem(item.label);
|
|
2537
|
+
this.handleUserListVisibility(item.label);
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
selectMenuItem(menuItemLabel) {
|
|
2541
|
+
this.selectedMenuItem = menuItemLabel;
|
|
2542
|
+
this.documentStore.setSelectedMenuItem(menuItemLabel);
|
|
2543
|
+
this.handleUserListVisibility(menuItemLabel);
|
|
2544
|
+
}
|
|
2545
|
+
// Method to programmatically unselect menu item
|
|
2546
|
+
unselectMenuItem() {
|
|
2547
|
+
this.selectedMenuItem = null;
|
|
2548
|
+
this.documentStore.setSelectedMenuItem(null);
|
|
2549
|
+
}
|
|
2550
|
+
// Method to check if a menu item is selected
|
|
2551
|
+
isMenuItemSelected(menuItemLabel) {
|
|
2552
|
+
return this.selectedMenuItem === menuItemLabel;
|
|
2553
|
+
}
|
|
2554
|
+
// Method to get the currently selected menu item
|
|
2555
|
+
getSelectedMenuItem() {
|
|
2556
|
+
return this.selectedMenuItem;
|
|
2557
|
+
}
|
|
2558
|
+
// Helper method to determine the category of a menu item
|
|
2559
|
+
getMenuItemCategory(menuItemLabel) {
|
|
2560
|
+
const applicationCategory = this.items.find((category) => category.label === 'Application');
|
|
2561
|
+
const applicantCategory = this.items.find((category) => category.label === 'Applicant');
|
|
2562
|
+
if (applicationCategory?.items?.some((menuItem) => menuItem.label === menuItemLabel)) {
|
|
2563
|
+
return 'Application';
|
|
2564
|
+
}
|
|
2565
|
+
else if (applicantCategory?.items?.some((menuItem) => menuItem.label === menuItemLabel)) {
|
|
2566
|
+
return 'Applicant';
|
|
2567
|
+
}
|
|
2568
|
+
return null;
|
|
2569
|
+
}
|
|
2570
|
+
// Helper method to handle user list visibility based on menu item category
|
|
2571
|
+
handleUserListVisibility(menuItemLabel) {
|
|
2572
|
+
const category = this.getMenuItemCategory(menuItemLabel);
|
|
2573
|
+
if (category === 'Application') {
|
|
2574
|
+
// Hide user list and reset filters when menu item is from Application category
|
|
2575
|
+
this.documentStore.setSelectedUserId(null);
|
|
2576
|
+
this.documentStore.setSelectedStatus(null);
|
|
2577
|
+
this.documentStore.setShowUserList(false);
|
|
2578
|
+
console.log('User list hidden for Application menu item:', menuItemLabel);
|
|
2579
|
+
}
|
|
2580
|
+
else if (category === 'Applicant') {
|
|
2581
|
+
// Show user list when menu item is from Applicant category
|
|
2582
|
+
this.documentStore.setShowUserList(true);
|
|
2583
|
+
console.log('User list shown for Applicant menu item:', menuItemLabel);
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentsMenuComponent, deps: [{ token: DocumentStore }, { token: DocumentQuery }], target: i0.ɵɵFactoryTarget.Component });
|
|
2587
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { items: "items" }, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\r\n <p-card class=\"widget-menu-wrapper h-full\">\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 - 00123882</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 <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"items\" 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]=\"isMenuItemSelected(item.label)\"\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.badge\" class=\"ml-auto \" severity=\"warning\" [value]=\"item.badge\" />\r\n <span *ngIf=\"item.shortcut\"\r\n class=\"ml-auto border-1 surface-border border-round surface-100 text-xs p-1\">{{ item.shortcut\r\n }}</span>\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-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-icon-wrapper{display:none}::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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i5$1.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "component", type: i6.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: i7$1.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }] });
|
|
1894
2588
|
}
|
|
1895
2589
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentsMenuComponent, decorators: [{
|
|
1896
2590
|
type: Component,
|
|
1897
|
-
args: [{ selector: 'lib-documents-menu', standalone: false, template: "<div class=\"document-sidebar-container h-full\">\r\n <p-card class=\"widget-menu-wrapper h-full\">\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 - 00123882</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 <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"items\" 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 class=\"flex align-items-center p-menuitem-link\">\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.badge\" class=\"ml-auto \" severity=\"warning\" [value]=\"item.badge\" />\r\n <span *ngIf=\"item.shortcut\"\r\n class=\"ml-auto border-1 surface-border border-round surface-100 text-xs p-1\">{{ item.shortcut\r\n }}</span>\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-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-icon-wrapper{display:none}::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 .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"] }]
|
|
1898
|
-
}] }
|
|
2591
|
+
args: [{ selector: 'lib-documents-menu', standalone: false, template: "<div class=\"document-sidebar-container h-full\">\r\n <p-card class=\"widget-menu-wrapper h-full\">\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 - 00123882</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 <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"items\" 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]=\"isMenuItemSelected(item.label)\"\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.badge\" class=\"ml-auto \" severity=\"warning\" [value]=\"item.badge\" />\r\n <span *ngIf=\"item.shortcut\"\r\n class=\"ml-auto border-1 surface-border border-round surface-100 text-xs p-1\">{{ item.shortcut\r\n }}</span>\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-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-icon-wrapper{display:none}::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"] }]
|
|
2592
|
+
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }], propDecorators: { items: [{
|
|
2593
|
+
type: Input
|
|
2594
|
+
}] } });
|
|
1899
2595
|
|
|
1900
2596
|
/**
|
|
1901
2597
|
*This component is responsible for managing and displaying a list of documents.
|
|
@@ -1950,6 +2646,7 @@ class DocumentContainerComponent {
|
|
|
1950
2646
|
* @type {Array}
|
|
1951
2647
|
*/
|
|
1952
2648
|
folderList = SHARED.EMPTY_ARRAY;
|
|
2649
|
+
items = SHARED.Menu;
|
|
1953
2650
|
/**
|
|
1954
2651
|
* Holds the subscription to manage observable cleanup.
|
|
1955
2652
|
* @private
|
|
@@ -1961,14 +2658,14 @@ class DocumentContainerComponent {
|
|
|
1961
2658
|
* @returns {void}
|
|
1962
2659
|
*/
|
|
1963
2660
|
ngOnInit() {
|
|
1964
|
-
this.fetchFolder();
|
|
2661
|
+
// this.fetchFolder();
|
|
1965
2662
|
const folderSubscription = this.documentQuery
|
|
1966
2663
|
.selectParentDocumentTypeId()
|
|
1967
2664
|
.subscribe((folderBlockId) => {
|
|
1968
2665
|
const validFolders = this.folderList.filter(folder => (folder.documentCount ?? 0) > 0);
|
|
1969
2666
|
const idToFetch = folderBlockId ?? validFolders[0]?._id;
|
|
1970
2667
|
if (idToFetch) {
|
|
1971
|
-
this.fetchDocuments(idToFetch);
|
|
2668
|
+
// this.fetchDocuments(idToFetch);
|
|
1972
2669
|
}
|
|
1973
2670
|
else {
|
|
1974
2671
|
console.warn('No folders with documents available.');
|
|
@@ -1994,7 +2691,7 @@ class DocumentContainerComponent {
|
|
|
1994
2691
|
if (folder && folder.length > 0) {
|
|
1995
2692
|
this.folderList = folder.filter(f => (f.documentCount ?? 0) > 0);
|
|
1996
2693
|
if (this.folderList.length > 0) {
|
|
1997
|
-
this.fetchDocuments(this.folderList[0]._id);
|
|
2694
|
+
// this.fetchDocuments(this.folderList[0]._id);
|
|
1998
2695
|
}
|
|
1999
2696
|
else {
|
|
2000
2697
|
console.warn('No folders with documents found.');
|
|
@@ -2051,11 +2748,11 @@ class DocumentContainerComponent {
|
|
|
2051
2748
|
this.subscription.unsubscribe();
|
|
2052
2749
|
}
|
|
2053
2750
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentStore }, { token: DocumentService$1 }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2054
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId", isCollapsed: "isCollapsed", showFolderList: "showFolderList", isUploadButtonVisible: "isUploadButtonVisible" }, 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></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [isCollapsed]=\"isCollapsed\" [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"], dependencies: [{ kind: "directive", type:
|
|
2751
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId", isCollapsed: "isCollapsed", showFolderList: "showFolderList", isUploadButtonVisible: "isUploadButtonVisible" }, 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 [items]=\"items\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [isCollapsed]=\"isCollapsed\" [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "isUploadButtonVisible", "isCollapsed", "documentList"], outputs: ["onRefresh"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["items"] }] });
|
|
2055
2752
|
}
|
|
2056
2753
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, decorators: [{
|
|
2057
2754
|
type: Component,
|
|
2058
|
-
args: [{ selector: 'lib-document-container', standalone: false, 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></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [isCollapsed]=\"isCollapsed\" [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"] }]
|
|
2755
|
+
args: [{ selector: 'lib-document-container', standalone: false, 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 [items]=\"items\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" [ngClass]=\"showFolderList ? 'custom-scroll' : ''\">\r\n @if(showFolderList){\r\n <div>\r\n <lib-folder-container [documentList]=\"documentList\" [folderList]=\"folderList\" [contextId]=\"contextId\"></lib-folder-container>\r\n </div>\r\n }\r\n <div [ngClass]=\"showFolderList ? 'mt-3' : ''\">\r\n <lib-document-list [isCollapsed]=\"isCollapsed\" [documentList]=\"documentList\" [contextId]=\"contextId\" [isUploadButtonVisible]=\"isUploadButtonVisible\" (onRefresh)=\"fetchFolder()\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"] }]
|
|
2059
2756
|
}], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentService$1 }, { type: DocumentQuery }, { type: DocumentHttpService }], propDecorators: { contextId: [{
|
|
2060
2757
|
type: Input
|
|
2061
2758
|
}], isCollapsed: [{
|
|
@@ -2066,6 +2763,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2066
2763
|
type: Input
|
|
2067
2764
|
}] } });
|
|
2068
2765
|
|
|
2766
|
+
/**
|
|
2767
|
+
* The `FolderBlockComponent` is responsible for displaying a block of folders and
|
|
2768
|
+
* providing filtering functionality based on folder IDs.
|
|
2769
|
+
*
|
|
2770
|
+
* It uses data from the `DocumentStore` and constants from the `SHARED` configuration
|
|
2771
|
+
* to display missing and pending file counts.
|
|
2772
|
+
*/
|
|
2773
|
+
class FolderBlockComponent {
|
|
2774
|
+
documentStore;
|
|
2775
|
+
/**
|
|
2776
|
+
* Array of folder blocks data to display.
|
|
2777
|
+
* Each folder is represented as a `FolderBlockModel`.
|
|
2778
|
+
*/
|
|
2779
|
+
folderList = SHARED.EMPTY_ARRAY;
|
|
2780
|
+
/** Number of missing files, sourced from the `SHARED` constants. */
|
|
2781
|
+
missingFileCount = SHARED.MISSINGCOUNT;
|
|
2782
|
+
/** Number of pending files, sourced from the `SHARED` constants. */
|
|
2783
|
+
pendingFileCount = SHARED.PENDINGCOUNT;
|
|
2784
|
+
/**
|
|
2785
|
+
* Injects the `DocumentStore` service to manage and access document-related state.
|
|
2786
|
+
* @param {DocumentStore} documentStore - The state management store for documents.
|
|
2787
|
+
*/
|
|
2788
|
+
constructor(documentStore) {
|
|
2789
|
+
this.documentStore = documentStore;
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Handles the click event for filtering based on the provided folder ID.
|
|
2793
|
+
* This method validates the folder ID and returns it for further processing.
|
|
2794
|
+
* If the folder ID is not provided, an empty string is returned.
|
|
2795
|
+
* @param {string} folderBlockId - The unique identifier of the folder to filter by.
|
|
2796
|
+
* @returns {string} The validated folder ID, or an empty string if the input is invalid.
|
|
2797
|
+
*/
|
|
2798
|
+
handleClickForFilter(folderBlockId) {
|
|
2799
|
+
if (!folderBlockId) {
|
|
2800
|
+
return SHARED.EMPTY;
|
|
2801
|
+
}
|
|
2802
|
+
this.documentStore.setParentDocumentTypeId(folderBlockId);
|
|
2803
|
+
return folderBlockId;
|
|
2804
|
+
}
|
|
2805
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderBlockComponent, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
2806
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", 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: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2807
|
+
}
|
|
2808
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderBlockComponent, decorators: [{
|
|
2809
|
+
type: Component,
|
|
2810
|
+
args: [{ selector: 'lib-folder-block', standalone: false, 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"] }]
|
|
2811
|
+
}], ctorParameters: () => [{ type: DocumentStore }], propDecorators: { folderList: [{
|
|
2812
|
+
type: Input
|
|
2813
|
+
}] } });
|
|
2814
|
+
|
|
2815
|
+
/**
|
|
2816
|
+
* DocumentListItemComponent
|
|
2817
|
+
*
|
|
2818
|
+
* This component displays individual document items within a list.
|
|
2819
|
+
* It accepts a list of documents as input and handles interactions with documents.
|
|
2820
|
+
*/
|
|
2821
|
+
class DocumentListItemComponent {
|
|
2822
|
+
/**
|
|
2823
|
+
* Emit the selected document.
|
|
2824
|
+
* @type {EventEmitter<DocumentModel>}
|
|
2825
|
+
*/
|
|
2826
|
+
documentClick = new EventEmitter();
|
|
2827
|
+
/**
|
|
2828
|
+
* The document to display.
|
|
2829
|
+
* @type {DocumentModel[]}
|
|
2830
|
+
*/
|
|
2831
|
+
document;
|
|
2832
|
+
/**
|
|
2833
|
+
* Handles interactions with a document.
|
|
2834
|
+
* @param {DocumentModel} document - The document to be opened or interacted with.
|
|
2835
|
+
*/
|
|
2836
|
+
handleOpenDocument(document) {
|
|
2837
|
+
if (!document) {
|
|
2838
|
+
console.error('Error: Document is null or undefined:', document);
|
|
2839
|
+
return;
|
|
2840
|
+
}
|
|
2841
|
+
this.documentClick.emit(document);
|
|
2842
|
+
}
|
|
2843
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2844
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", 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: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2845
|
+
}
|
|
2846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, decorators: [{
|
|
2847
|
+
type: Component,
|
|
2848
|
+
args: [{ selector: 'lib-document-list-item', standalone: false, 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"] }]
|
|
2849
|
+
}], propDecorators: { documentClick: [{
|
|
2850
|
+
type: Output
|
|
2851
|
+
}], document: [{
|
|
2852
|
+
type: Input
|
|
2853
|
+
}] } });
|
|
2854
|
+
|
|
2069
2855
|
/**
|
|
2070
2856
|
* GlobalErrorHandler is a custom error handler that implements the ErrorHandler interface.
|
|
2071
2857
|
* It is used to handle both HTTP errors and other types of errors globally in the application.
|
|
@@ -2134,6 +2920,171 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2134
2920
|
}]
|
|
2135
2921
|
}], ctorParameters: () => [{ type: DocumentService }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
|
|
2136
2922
|
|
|
2923
|
+
/**
|
|
2924
|
+
* Service for managing user session details.
|
|
2925
|
+
* @class SessionService
|
|
2926
|
+
* @typedef {SessionService}
|
|
2927
|
+
*/
|
|
2928
|
+
class SessionService {
|
|
2929
|
+
router;
|
|
2930
|
+
/**
|
|
2931
|
+
* Creates an instance of SessionService.
|
|
2932
|
+
* @param {Router} router - Angular Router for navigation.
|
|
2933
|
+
*/
|
|
2934
|
+
constructor(router) {
|
|
2935
|
+
this.router = router;
|
|
2936
|
+
}
|
|
2937
|
+
/**
|
|
2938
|
+
* Retrieves the current user's role from local storage.
|
|
2939
|
+
* @returns {string | null} The user's role, or null if not found.
|
|
2940
|
+
*/
|
|
2941
|
+
getUserRole() {
|
|
2942
|
+
return localStorage.getItem('role');
|
|
2943
|
+
}
|
|
2944
|
+
/**
|
|
2945
|
+
* Stores the user session data in local storage.
|
|
2946
|
+
* @param {any} data - The session data to store.
|
|
2947
|
+
*/
|
|
2948
|
+
setUserSession(data) {
|
|
2949
|
+
localStorage.setItem(SHARED.SESSIONKEY, JSON.stringify(data));
|
|
2950
|
+
}
|
|
2951
|
+
/**
|
|
2952
|
+
* Retrieves the stored user session data.
|
|
2953
|
+
* @returns {any | null} The parsed session data, or null if not found.
|
|
2954
|
+
*/
|
|
2955
|
+
getUserSession() {
|
|
2956
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
2957
|
+
return sessionData ? JSON.parse(sessionData) : null;
|
|
2958
|
+
}
|
|
2959
|
+
/**
|
|
2960
|
+
* Retrieves the user's permissions from the stored session data.
|
|
2961
|
+
* @returns {any | null} The user's permissions, or null if not found.
|
|
2962
|
+
*/
|
|
2963
|
+
getUserPermissions() {
|
|
2964
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
2965
|
+
return sessionData ? JSON.parse(sessionData).permissions : null;
|
|
2966
|
+
}
|
|
2967
|
+
/**
|
|
2968
|
+
* Retrieves the session ID from the stored session data.
|
|
2969
|
+
* @returns {any | null} The session ID, or null if not found.
|
|
2970
|
+
*/
|
|
2971
|
+
getSessionID() {
|
|
2972
|
+
const sessionData = localStorage.getItem(SHARED.SESSIONKEY);
|
|
2973
|
+
console.log(sessionData);
|
|
2974
|
+
if (sessionData) {
|
|
2975
|
+
const sessionId = JSON.parse(sessionData);
|
|
2976
|
+
console.log(sessionId);
|
|
2977
|
+
return sessionId;
|
|
2978
|
+
}
|
|
2979
|
+
return null;
|
|
2980
|
+
}
|
|
2981
|
+
/**
|
|
2982
|
+
* Clears all stored session data from local storage.
|
|
2983
|
+
*/
|
|
2984
|
+
clearSession() {
|
|
2985
|
+
localStorage.clear();
|
|
2986
|
+
}
|
|
2987
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2988
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
2989
|
+
}
|
|
2990
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, decorators: [{
|
|
2991
|
+
type: Injectable,
|
|
2992
|
+
args: [{
|
|
2993
|
+
providedIn: 'root'
|
|
2994
|
+
}]
|
|
2995
|
+
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
2996
|
+
|
|
2997
|
+
/**
|
|
2998
|
+
* Directive to conditionally show or hide elements based on user permissions.
|
|
2999
|
+
* @class HasPermissionDirective
|
|
3000
|
+
* @typedef {HasPermissionDirective}
|
|
3001
|
+
*/
|
|
3002
|
+
class HasPermissionDirective {
|
|
3003
|
+
el;
|
|
3004
|
+
renderer;
|
|
3005
|
+
sessionService;
|
|
3006
|
+
/**
|
|
3007
|
+
* The required permission(s) to display the element.
|
|
3008
|
+
* Accepts a single string or an array of strings.
|
|
3009
|
+
* @type {string | string[]}
|
|
3010
|
+
*/
|
|
3011
|
+
permission;
|
|
3012
|
+
/**
|
|
3013
|
+
* Creates an instance of HasPermissionDirective.
|
|
3014
|
+
* @param {ElementRef} el - Reference to the host element.
|
|
3015
|
+
* @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
|
|
3016
|
+
* @param {SessionService} sessionService - Service to retrieve user permissions.
|
|
3017
|
+
*/
|
|
3018
|
+
constructor(el, renderer, sessionService) {
|
|
3019
|
+
this.el = el;
|
|
3020
|
+
this.renderer = renderer;
|
|
3021
|
+
this.sessionService = sessionService;
|
|
3022
|
+
}
|
|
3023
|
+
/**
|
|
3024
|
+
* Lifecycle hook that is called when input properties change.
|
|
3025
|
+
* @param {SimpleChanges} changes - The changes in input properties.
|
|
3026
|
+
*/
|
|
3027
|
+
ngOnChanges(changes) {
|
|
3028
|
+
if (changes['permission']) {
|
|
3029
|
+
this.checkPermission();
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Checks if the user has the required permission(s).
|
|
3034
|
+
* Hides the element if the permission is not found.
|
|
3035
|
+
*/
|
|
3036
|
+
checkPermission() {
|
|
3037
|
+
const userPermissionsObjects = this.sessionService.getUserPermissions();
|
|
3038
|
+
const userPermissionNames = userPermissionsObjects?.map((perm) => perm.name) || [];
|
|
3039
|
+
const requiredPermissions = Array.isArray(this.permission)
|
|
3040
|
+
? this.permission
|
|
3041
|
+
: [this.permission];
|
|
3042
|
+
const hasPermission = requiredPermissions.some(permission => userPermissionNames.includes(permission));
|
|
3043
|
+
if (!hasPermission) {
|
|
3044
|
+
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
3045
|
+
}
|
|
3046
|
+
else {
|
|
3047
|
+
this.renderer.removeStyle(this.el.nativeElement, 'display');
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3051
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
|
|
3052
|
+
}
|
|
3053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
3054
|
+
type: Directive,
|
|
3055
|
+
args: [{
|
|
3056
|
+
selector: '[permission]',
|
|
3057
|
+
standalone: false
|
|
3058
|
+
}]
|
|
3059
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SessionService }], propDecorators: { permission: [{
|
|
3060
|
+
type: Input
|
|
3061
|
+
}] } });
|
|
3062
|
+
|
|
3063
|
+
class SharedModule {
|
|
3064
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3065
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: SharedModule, declarations: [TablePrimaryComponent], imports: [CommonModule,
|
|
3066
|
+
TableModule,
|
|
3067
|
+
ButtonModule,
|
|
3068
|
+
RippleModule], exports: [TablePrimaryComponent] });
|
|
3069
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SharedModule, imports: [CommonModule,
|
|
3070
|
+
TableModule,
|
|
3071
|
+
ButtonModule,
|
|
3072
|
+
RippleModule] });
|
|
3073
|
+
}
|
|
3074
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SharedModule, decorators: [{
|
|
3075
|
+
type: NgModule,
|
|
3076
|
+
args: [{
|
|
3077
|
+
declarations: [TablePrimaryComponent],
|
|
3078
|
+
imports: [
|
|
3079
|
+
CommonModule,
|
|
3080
|
+
TableModule,
|
|
3081
|
+
ButtonModule,
|
|
3082
|
+
RippleModule
|
|
3083
|
+
],
|
|
3084
|
+
exports: [TablePrimaryComponent]
|
|
3085
|
+
}]
|
|
3086
|
+
}] });
|
|
3087
|
+
|
|
2137
3088
|
/**
|
|
2138
3089
|
* @module DocumentModule
|
|
2139
3090
|
*
|
|
@@ -2189,7 +3140,9 @@ class DocumentModule {
|
|
|
2189
3140
|
* A component which have linked documents.
|
|
2190
3141
|
*/
|
|
2191
3142
|
LinkedDocumentComponent,
|
|
2192
|
-
DocumentsMenuComponent
|
|
3143
|
+
DocumentsMenuComponent,
|
|
3144
|
+
UserListComponent,
|
|
3145
|
+
DocumentStatusComponent], imports: [
|
|
2193
3146
|
/**
|
|
2194
3147
|
* Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
|
|
2195
3148
|
*/
|
|
@@ -2260,7 +3213,9 @@ class DocumentModule {
|
|
|
2260
3213
|
InputTextModule,
|
|
2261
3214
|
MenuModule,
|
|
2262
3215
|
PanelMenuModule,
|
|
2263
|
-
CardModule
|
|
3216
|
+
CardModule,
|
|
3217
|
+
TableModule,
|
|
3218
|
+
SharedModule], exports: [
|
|
2264
3219
|
/**
|
|
2265
3220
|
* A directive to give permission.
|
|
2266
3221
|
*/
|
|
@@ -2384,7 +3339,9 @@ class DocumentModule {
|
|
|
2384
3339
|
InputTextModule,
|
|
2385
3340
|
MenuModule,
|
|
2386
3341
|
PanelMenuModule,
|
|
2387
|
-
CardModule
|
|
3342
|
+
CardModule,
|
|
3343
|
+
TableModule,
|
|
3344
|
+
SharedModule] });
|
|
2388
3345
|
}
|
|
2389
3346
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, decorators: [{
|
|
2390
3347
|
type: NgModule,
|
|
@@ -2436,6 +3393,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2436
3393
|
*/
|
|
2437
3394
|
LinkedDocumentComponent,
|
|
2438
3395
|
DocumentsMenuComponent,
|
|
3396
|
+
UserListComponent,
|
|
3397
|
+
DocumentStatusComponent,
|
|
2439
3398
|
],
|
|
2440
3399
|
imports: [
|
|
2441
3400
|
/**
|
|
@@ -2508,7 +3467,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2508
3467
|
InputTextModule,
|
|
2509
3468
|
MenuModule,
|
|
2510
3469
|
PanelMenuModule,
|
|
2511
|
-
CardModule
|
|
3470
|
+
CardModule,
|
|
3471
|
+
TableModule,
|
|
3472
|
+
SharedModule
|
|
2512
3473
|
],
|
|
2513
3474
|
exports: [
|
|
2514
3475
|
/**
|
|
@@ -2576,5 +3537,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2576
3537
|
* Generated bundle index. Do not edit.
|
|
2577
3538
|
*/
|
|
2578
3539
|
|
|
2579
|
-
export { DocumentContainerComponent, DocumentDirective, DocumentListComponent, DocumentModule, DocumentViewerComponent, HasPermissionDirective };
|
|
3540
|
+
export { DocumentContainerComponent, DocumentDirective, DocumentListComponent, DocumentModule, DocumentTableBuilderService, DocumentViewerComponent, HasPermissionDirective };
|
|
2580
3541
|
//# sourceMappingURL=cat-documents-ng.mjs.map
|