cat-documents-ng 0.2.34 → 0.2.35

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.
Files changed (30) hide show
  1. package/Shared/components/table-primary/table-primary.component.d.ts +4 -2
  2. package/Shared/constant/ERROR.d.ts +1 -0
  3. package/Shared/constant/SHARED.d.ts +67 -0
  4. package/Shared/constant/URLS.d.ts +22 -0
  5. package/fesm2022/cat-documents-ng.mjs +1256 -587
  6. package/fesm2022/cat-documents-ng.mjs.map +1 -1
  7. package/lib/document/components/document-container/document-container.component.d.ts +36 -35
  8. package/lib/document/components/document-list/document-list.component.d.ts +52 -34
  9. package/lib/document/components/document-status/document-status.component.d.ts +11 -14
  10. package/lib/document/components/document-viewer/document-viewer.component.d.ts +6 -6
  11. package/lib/document/components/documents-menu/documents-menu.component.d.ts +33 -11
  12. package/lib/document/components/folder-container/folder-container.component.d.ts +23 -6
  13. package/lib/document/components/linked-document/linked-document.component.d.ts +5 -4
  14. package/lib/document/components/user-list/user-list.component.d.ts +19 -22
  15. package/lib/document/directives/document.directive.d.ts +2 -2
  16. package/lib/document/models/document-category.model.d.ts +19 -0
  17. package/lib/document/models/document-list-response.model.d.ts +24 -0
  18. package/lib/document/models/status-data.model.d.ts +27 -0
  19. package/lib/document/models/user-list.model.d.ts +8 -0
  20. package/lib/document/services/document-http.service.d.ts +28 -2
  21. package/lib/document/services/document-menu.service.d.ts +65 -0
  22. package/lib/document/services/document-table-builder.service.d.ts +34 -30
  23. package/lib/document/services/document.service.d.ts +29 -8
  24. package/lib/document/services/status-calculator.service.d.ts +20 -0
  25. package/lib/document/services/user-list.service.d.ts +36 -0
  26. package/lib/document/state/document.query.d.ts +52 -1
  27. package/lib/document/state/document.state.d.ts +9 -0
  28. package/lib/document/state/document.store.d.ts +9 -0
  29. package/package.json +1 -1
  30. package/lib/document/models/document-status.model.d.ts +0 -6
@@ -1,14 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Output, Input, ViewEncapsulation, ViewChild, Directive, NgModule, APP_INITIALIZER } from '@angular/core';
3
- import * as i4 from '@angular/common';
2
+ import { Injectable, EventEmitter, Output, Input, Component, ViewChild, ViewEncapsulation, Directive, NgModule, APP_INITIALIZER } from '@angular/core';
3
+ import * as i5 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import { firstValueFrom, tap, EMPTY, catchError, throwError, BehaviorSubject, combineLatest, Subscription } from 'rxjs';
5
+ import { firstValueFrom, tap, EMPTY, catchError, throwError, 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
9
  import { HttpParams, HttpClientModule } from '@angular/common/http';
10
- import { trigger, state, style, transition, animate } from '@angular/animations';
11
10
  import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
11
+ import { trigger, state, transition, style, animate } from '@angular/animations';
12
12
  import * as i3 from 'primeng/api';
13
13
  import { MessageService } from 'primeng/api';
14
14
  import * as i8 from 'primeng/button';
@@ -26,19 +26,19 @@ import * as i14 from 'primeng/inputtext';
26
26
  import { InputTextModule } from 'primeng/inputtext';
27
27
  import * as i2$1 from 'primeng/table';
28
28
  import { TableModule } from 'primeng/table';
29
- import * as i5 from 'primeng/ripple';
29
+ import * as i5$1 from 'primeng/ripple';
30
30
  import { RippleModule } from 'primeng/ripple';
31
31
  import * as i7 from 'primeng/fileupload';
32
32
  import { FileUploadModule } from 'primeng/fileupload';
33
33
  import * as i8$1 from 'primeng/progressbar';
34
34
  import { ProgressBarModule } from 'primeng/progressbar';
35
- import * as i4$1 from 'ng2-pdf-viewer';
35
+ import * as i4 from 'ng2-pdf-viewer';
36
36
  import { PdfViewerModule } from 'ng2-pdf-viewer';
37
- import * as i5$1 from 'primeng/badge';
37
+ import * as i7$1 from 'primeng/badge';
38
38
  import { BadgeModule } from 'primeng/badge';
39
- import * as i6 from 'primeng/menu';
39
+ import * as i8$2 from 'primeng/menu';
40
40
  import { MenuModule } from 'primeng/menu';
41
- import * as i7$1 from 'primeng/card';
41
+ import * as i9$1 from 'primeng/card';
42
42
  import { CardModule } from 'primeng/card';
43
43
  import { AccordionModule } from 'primeng/accordion';
44
44
  import { ListboxModule } from 'primeng/listbox';
@@ -53,6 +53,34 @@ import { PanelMenuModule } from 'primeng/panelmenu';
53
53
  * These constants are related to document statuses and other shared data.
54
54
  */
55
55
  class SHARED {
56
+ /**
57
+ * Represents the info.
58
+ */
59
+ static VISIBLE = 'visible';
60
+ /**
61
+ * Represents the info.
62
+ */
63
+ static HIDDEN = 'hidden';
64
+ /**
65
+ * Represents the info.
66
+ */
67
+ static APPLICATION_DOCS = 'Application Docs';
68
+ /**
69
+ * Represents the info.
70
+ */
71
+ static INFO = 'info';
72
+ /**
73
+ * Represents the success.
74
+ */
75
+ static SUCCESS = 'success';
76
+ /**
77
+ * Represents the warning.
78
+ */
79
+ static WARNING = 'warning';
80
+ /**
81
+ * Represents the warning.
82
+ */
83
+ static DANGER = 'danger';
56
84
  /**
57
85
  * Represents the stores userData.
58
86
  */
@@ -113,6 +141,24 @@ class SHARED {
113
141
  * @type {string}
114
142
  */
115
143
  static FILE = 'file';
144
+ /**
145
+ * Query parameter for menu item filter.
146
+ * @static
147
+ * @type {string}
148
+ */
149
+ static MENU_ITEM_PARAM = 'menuItem';
150
+ /**
151
+ * Query parameter for user ID filter.
152
+ * @static
153
+ * @type {string}
154
+ */
155
+ static USER_ID_PARAM = 'userId';
156
+ /**
157
+ * Query parameter for status filter.
158
+ * @static
159
+ * @type {string}
160
+ */
161
+ static STATUS_PARAM = 'status';
116
162
  /**
117
163
  * Represents the array of file size units ('B', 'KB', 'MB') used for file size formatting.
118
164
  * @static
@@ -155,6 +201,12 @@ class SHARED {
155
201
  * @type {string}
156
202
  */
157
203
  static CONTEXT_ID = 'contextId';
204
+ /**
205
+ * Represent contextId.
206
+ * @static
207
+ * @type {string}
208
+ */
209
+ static CATEGORY = 'category';
158
210
  /**
159
211
  * Represent fileSize.
160
212
  * @static
@@ -283,6 +335,21 @@ class SHARED {
283
335
  ]
284
336
  }
285
337
  ];
338
+ static APPLICATION = 'Application';
339
+ static APPLICANTS = 'Applicants';
340
+ static EMPTY_SPACE = ' ';
341
+ static COLORS = ['orange', 'blue', 'green', 'grey', 'purple'];
342
+ static COLOR_MAP = {
343
+ 'orange': '#f97316',
344
+ 'blue': '#3b82f6',
345
+ 'green': '#10b981',
346
+ 'grey': '#6b7280',
347
+ 'purple': '#8b5cf6'
348
+ };
349
+ static DEFAULT_COLOR = '#3b82f6';
350
+ static STATUS_WITH_DASH = 'status-';
351
+ static ICON_WITH_DASH = 'icon-';
352
+ static SEARCH_KEY = 'searchKey';
286
353
  }
287
354
  /**
288
355
  * `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
@@ -457,9 +524,9 @@ const DUMMY_DOCUMENT_SECTIONS = [
457
524
  approvedDocument: 1,
458
525
  list: [
459
526
  {
460
- documentName: "passport_emma_wilson_2025.pdf",
527
+ documentName: "passport_emilia_wilson_2025.pdf",
461
528
  documentType: "Passport",
462
- documentUrl: "https://example.com/documents/passport_emma_wilson_2025.pdf",
529
+ documentUrl: "https://example.com/documents/passport_emilia_wilson_2025.pdf",
463
530
  status: "Pending",
464
531
  applicantName: "Charlotte Anderson",
465
532
  uploadedTime: "28 May 2025"
@@ -508,139 +575,62 @@ const DUMMY_DOCUMENT_SECTIONS = [
508
575
  },
509
576
  {
510
577
  header: "Income",
511
- description: "Employment and income verification documents",
578
+ description: "Personal Income documents required for verification",
512
579
  pendingDocument: 1,
513
580
  approvedDocument: 1,
514
581
  list: [
515
582
  {
516
- documentName: "latest_payslip_charlotte_2025.pdf",
517
- documentType: "Latest Payslip",
518
- documentUrl: "https://example.com/documents/latest_payslip_charlotte_2025.pdf",
583
+ documentName: "passport_emilia_wilson_2025.pdf",
584
+ documentType: "Passport",
585
+ documentUrl: "https://example.com/documents/passport_emilia_wilson_2025.pdf",
519
586
  status: "Pending",
520
587
  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"
588
+ uploadedTime: "28 May 2025"
530
589
  },
531
590
  {
532
- documentName: "employer_reference_benjamin_2025.pdf",
533
- documentType: "Employer Reference",
534
- documentUrl: "https://example.com/documents/employer_reference_benjamin_2025.pdf",
591
+ documentName: "driving_license_benjamin_mitchell_2025.jpg",
592
+ documentType: "Driving License",
593
+ documentUrl: "https://example.com/documents/driving_license_benjamin_mitchell_2025.jpg",
535
594
  status: "Approved",
536
595
  applicantName: "Benjamin Mitchell",
537
596
  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
597
  },
555
598
  {
556
- documentName: "budget_planner_sophia_2025.xlsx",
557
- documentType: "Budget Planner",
558
- documentUrl: "https://example.com/documents/budget_planner_sophia_2025.xlsx",
599
+ documentName: "british_gas_bill_may_2025.pdf",
600
+ documentType: "Utility Bill",
601
+ documentUrl: "https://example.com/documents/british_gas_bill_may_2025.pdf",
559
602
  status: "Alert",
560
603
  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: [
604
+ uploadedTime: "26 May 2025"
605
+ },
571
606
  {
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"
607
+ documentName: "council_tax_oliver_thompson_2025_2026.pdf",
608
+ documentType: "Council Tax Bill",
609
+ documentUrl: "https://example.com/documents/council_tax_oliver_thompson_2025_2026.pdf",
610
+ status: "Uploaded",
611
+ applicantName: "Oliver Thompson",
612
+ uploadedTime: "30 May 2025"
578
613
  },
579
614
  {
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: [
615
+ documentName: "certified_id_oliver_thompson_2025.pdf",
616
+ documentType: "Certified ID",
617
+ documentUrl: "https://example.com/documents/certified_id_oliver_thompson_2025.pdf",
618
+ status: "Reviewing",
619
+ applicantName: "Oliver Thompson",
620
+ uploadedTime: "02 Jun 2025"
621
+ },
595
622
  {
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"
623
+ documentName: "proof_of_address_oliver_thompson_2025.pdf",
624
+ documentType: "Proof of Address",
625
+ documentUrl: "https://example.com/documents/proof_of_address_oliver_thompson_2025.pdf",
626
+ status: "Rejected",
627
+ applicantName: "Oliver Thompson",
628
+ uploadedTime: "02 Jun 2025"
602
629
  }
603
630
  ]
604
631
  }
605
632
  ];
606
633
 
607
- /**
608
- * A utility class containing common error messages.
609
- * @class ERRORS
610
- */
611
- class ERRORS {
612
- /**
613
- * Error message for invalid recipient.
614
- * @static
615
- * @type {string}
616
- */
617
- static INVALID_RECIPIENT = "Invalid recipient: The recipient cannot be empty.";
618
- /**
619
- * Error message for invalid document.
620
- * @static
621
- * @type {string}
622
- */
623
- static ERROR_FETCHING_DOCUMENTS = "Error fetching documents:";
624
- /**
625
- * Error message for invalid document.
626
- * @static
627
- * @type {string}
628
- */
629
- static ERROR_FETCHING_FOLDERS = "Error fetching folders:";
630
- /**
631
- * Error message for invalid document.
632
- * @static
633
- * @type {string}
634
- */
635
- static ERROR_ALLDOCUMENT_MISSING = "allDocumentTypes is missing in the response:";
636
- /**
637
- * Error message for invalid document.
638
- * @static
639
- * @type {string}
640
- */
641
- static ERROR_DOCUMENT_TYPES = "Error fetching document types:";
642
- }
643
-
644
634
  /**
645
635
  * Creates the initial state for the `DocumentState` store.
646
636
  * This function provides default values for all properties in the `DocumentState` interface,
@@ -660,12 +650,15 @@ function createInitialState() {
660
650
  folders: [],
661
651
  messages: [],
662
652
  documentList: [],
663
- // Initialize new selection properties
653
+ documentCategories: [],
664
654
  selectedMenuItem: null,
665
655
  selectedUserId: null,
666
656
  selectedStatus: null,
667
- // Initialize user list visibility to true
668
- showUserList: true
657
+ showUserList: true,
658
+ currentDocument: null,
659
+ userList: [],
660
+ statusData: [],
661
+ documentListResponse: null
669
662
  };
670
663
  }
671
664
 
@@ -704,6 +697,9 @@ let DocumentStore = class DocumentStore extends EntityStore {
704
697
  setDocumentList(documents) {
705
698
  this.update({ documents: documents });
706
699
  }
700
+ setDocumentCategories(categories) {
701
+ this.update({ documentCategories: categories });
702
+ }
707
703
  // New methods for selection state management
708
704
  setSelectedMenuItem(menuItem) {
709
705
  this.update({ selectedMenuItem: menuItem });
@@ -735,13 +731,29 @@ let DocumentStore = class DocumentStore extends EntityStore {
735
731
  setShowUserList(show) {
736
732
  this.update({ showUserList: show });
737
733
  }
738
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
739
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, providedIn: 'root' });
734
+ // Method to set the current document
735
+ setCurrentDocument(document) {
736
+ this.update({ currentDocument: document });
737
+ }
738
+ // Method to set the user list
739
+ setUserList(userList) {
740
+ this.update({ userList: userList });
741
+ }
742
+ // Method to set the status data
743
+ setStatusData(statusData) {
744
+ this.update({ statusData: statusData });
745
+ }
746
+ // Method to set the document list response
747
+ setDocumentListResponse(response) {
748
+ this.update({ documentListResponse: response });
749
+ }
750
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
751
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStore, providedIn: 'root' });
740
752
  };
741
753
  DocumentStore = __decorate([
742
754
  StoreConfig({ name: 'documents' })
743
755
  ], DocumentStore);
744
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStore, decorators: [{
756
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStore, decorators: [{
745
757
  type: Injectable,
746
758
  args: [{ providedIn: 'root' }]
747
759
  }], ctorParameters: () => [] });
@@ -767,6 +779,13 @@ class URLS {
767
779
  * @type {string}
768
780
  */
769
781
  static DOCUMENT_UPLOAD = "Documents";
782
+ /**
783
+ * The URL endpoint for document uploads.
784
+ * Used to send documents to the server for storage or processing.
785
+ * @static
786
+ * @type {string}
787
+ */
788
+ static DOCUMENTS_CATAGORIES = "documents/getAllCategoriesByApplicationId";
770
789
  /**
771
790
  * The query parameter to pass a context ID in API requests.
772
791
  * Used to specify the context for certain API calls, such as filtering or scoping the request.
@@ -798,6 +817,19 @@ class URLS {
798
817
  * @type {string}
799
818
  */
800
819
  static PARENT_DOCUMENT_TYPE_ID = "parentDocumentType?parentDocumentTypeId=";
820
+ /**
821
+ * The query parameter to pass a document ID in API requests.
822
+ * @static
823
+ * @type {string}
824
+ */
825
+ static USERLIST = "documents/getContextIdListByApplicationId/";
826
+ /**
827
+ * The URL endpoint for getting document status count by context ID.
828
+ * Used to fetch status data with applicationId, contextId, and category parameters.
829
+ * @static
830
+ * @type {string}
831
+ */
832
+ static STATUS_DOCUMENT_COUNT = "documents/getStatusDocumentCountByContextId/";
801
833
  /**
802
834
  * The query parameter to pass a context ID in API requests.
803
835
  * Used to specify the context for certain API calls, such as filtering or scoping the request.
@@ -805,6 +837,8 @@ class URLS {
805
837
  * @type {string}
806
838
  */
807
839
  static CONTEXT_ID = "&contextId=";
840
+ static GETALL = "documents/getAllByContextId";
841
+ static DOCUMENT_LIST = "list";
808
842
  }
809
843
 
810
844
  /**
@@ -868,10 +902,10 @@ class AppConfigService {
868
902
  get visibilityOptions() {
869
903
  return this.appConfig?.visibilityOption;
870
904
  }
871
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, deps: [{ token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
872
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, providedIn: 'root' });
905
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigService, deps: [{ token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
906
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigService, providedIn: 'root' });
873
907
  }
874
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: AppConfigService, decorators: [{
908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AppConfigService, decorators: [{
875
909
  type: Injectable,
876
910
  args: [{
877
911
  providedIn: 'root'
@@ -886,7 +920,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
886
920
  * @param {DocumentStore} documentStore - The store that manages the state of documents.
887
921
  * @param {HttpClient} http - The Angular HTTP client for making API requests.
888
922
  */
889
- let DocumentService$1 = class DocumentService {
923
+ class DocumentService {
890
924
  documentStore;
891
925
  http;
892
926
  appConfigService;
@@ -949,10 +983,10 @@ let DocumentService$1 = class DocumentService {
949
983
  delete(id) {
950
984
  return this.http.delete(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(tap(() => this.documentStore.remove(id)));
951
985
  }
952
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
953
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, providedIn: 'root' });
954
- };
955
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService$1, decorators: [{
986
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
987
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentService, providedIn: 'root' });
988
+ }
989
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentService, decorators: [{
956
990
  type: Injectable,
957
991
  args: [{ providedIn: 'root' }]
958
992
  }], ctorParameters: () => [{ type: DocumentStore }, { type: i2.HttpClient }, { type: AppConfigService }] });
@@ -998,10 +1032,17 @@ class DocumentQuery extends QueryEntity {
998
1032
  selectDocumets() {
999
1033
  return this.select((state) => state.documentList);
1000
1034
  }
1035
+ /**
1036
+ * Selects the document categories.
1037
+ * @returns {Observable<DocumentCategory[]>} Observable that emits the document categories.
1038
+ */
1039
+ selectDocumentCategories() {
1040
+ return this.select((state) => state.documentCategories);
1041
+ }
1001
1042
  // New query methods for selection state
1002
1043
  /**
1003
1044
  * Selects the currently selected menu item.
1004
- * @returns {Observable<string | null>} Observable that emits the currently selected menu item.
1045
+ * @returns {Observable<string | null>} Observable that emits the currently selected menu item _id (not the label).
1005
1046
  */
1006
1047
  selectSelectedMenuItem() {
1007
1048
  return this.select((state) => state.selectedMenuItem);
@@ -1023,6 +1064,7 @@ class DocumentQuery extends QueryEntity {
1023
1064
  /**
1024
1065
  * Selects all selection state properties (menu item, user ID, status).
1025
1066
  * @returns {Observable<{menuItem: string | null, userId: string | null, status: string | null}>} Observable that emits the current selection state.
1067
+ * Note: menuItem is the _id of the selected menu item, not the label.
1026
1068
  */
1027
1069
  selectSelectionState() {
1028
1070
  return this.select((state) => ({
@@ -1034,6 +1076,7 @@ class DocumentQuery extends QueryEntity {
1034
1076
  /**
1035
1077
  * Gets the current selection state values (synchronous).
1036
1078
  * @returns {Object} The current selection state values.
1079
+ * Note: menuItem is the _id of the selected menu item, not the label.
1037
1080
  */
1038
1081
  getSelectionState() {
1039
1082
  const state = this.getValue();
@@ -1057,10 +1100,66 @@ class DocumentQuery extends QueryEntity {
1057
1100
  getShowUserList() {
1058
1101
  return this.getValue().showUserList;
1059
1102
  }
1060
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
1061
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, providedIn: 'root' });
1103
+ /**
1104
+ * Selects the current document.
1105
+ * @returns {Observable<DocumentModel | null>} Observable that emits the current document.
1106
+ */
1107
+ selectCurrentDocument() {
1108
+ return this.select((state) => state.currentDocument);
1109
+ }
1110
+ /**
1111
+ * Gets the current document value (synchronous).
1112
+ * @returns {DocumentModel | null} The current document.
1113
+ */
1114
+ getCurrentDocument() {
1115
+ return this.getValue().currentDocument;
1116
+ }
1117
+ /**
1118
+ * Selects the user list.
1119
+ * @returns {Observable<UserListModel[]>} Observable that emits the user list.
1120
+ */
1121
+ selectUserList() {
1122
+ return this.select((state) => state.userList);
1123
+ }
1124
+ /**
1125
+ * Gets the current user list value (synchronous).
1126
+ * @returns {UserListModel[]} The current user list.
1127
+ */
1128
+ getUserList() {
1129
+ return this.getValue().userList;
1130
+ }
1131
+ /**
1132
+ * Selects the status data.
1133
+ * @returns {Observable<StatusDataModel[]>} Observable that emits the status data.
1134
+ */
1135
+ selectStatusData() {
1136
+ return this.select((state) => state.statusData);
1137
+ }
1138
+ /**
1139
+ * Gets the current status data value (synchronous).
1140
+ * @returns {StatusDataModel[]} The current status data.
1141
+ */
1142
+ getStatusData() {
1143
+ return this.getValue().statusData;
1144
+ }
1145
+ /**
1146
+ * Selects the document list response.
1147
+ * @returns {Observable<DocumentListResponse[] | null>} Observable that emits the document list response.
1148
+ */
1149
+ selectDocumentListResponse() {
1150
+ return this.select((state) => state.documentListResponse);
1151
+ }
1152
+ /**
1153
+ * Gets the current document list response value (synchronous).
1154
+ * @returns {DocumentListResponse[] | null} The current document list response.
1155
+ */
1156
+ getDocumentListResponse() {
1157
+ return this.getValue().documentListResponse;
1158
+ }
1159
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentQuery, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
1160
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentQuery, providedIn: 'root' });
1062
1161
  }
1063
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentQuery, decorators: [{
1162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentQuery, decorators: [{
1064
1163
  type: Injectable,
1065
1164
  args: [{ providedIn: 'root' }]
1066
1165
  }], ctorParameters: () => [{ type: DocumentStore }] });
@@ -1108,6 +1207,21 @@ class DocumentHttpService {
1108
1207
  return throwError(() => new Error(error));
1109
1208
  }));
1110
1209
  }
1210
+ /**
1211
+ * Fetches a document catagories by its path name.
1212
+ * Includes error handling for failed API requests.
1213
+ * @param {string} contextId - The context ID to fetch the document.
1214
+ * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
1215
+ */
1216
+ getDocumentCatagories(contextId) {
1217
+ if (!contextId)
1218
+ return EMPTY;
1219
+ return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`).pipe(tap((categories) => {
1220
+ this.documentStore.setDocumentCategories(categories);
1221
+ }), catchError((error) => {
1222
+ return throwError(() => new Error(error));
1223
+ }));
1224
+ }
1111
1225
  /**
1112
1226
  * Fetches a document by its path name and transforms the response for dropdown options.
1113
1227
  * Includes error handling for failed API requests.
@@ -1159,26 +1273,67 @@ class DocumentHttpService {
1159
1273
  }));
1160
1274
  }
1161
1275
  /**
1162
- * Fetches documents based on selection criteria (menu item, user ID, and status).
1276
+ * Fetches a userlist by its path name.
1277
+ * @param {string} contextId - The document ID to fetch the document.
1278
+ * @returns {Observable<UserListModel[]>} Observable that emits the user list data.
1279
+ */
1280
+ getUserListByContextId(contextId) {
1281
+ if (!contextId)
1282
+ return EMPTY;
1283
+ return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`).pipe(tap((userList) => {
1284
+ this.documentStore.setUserList(userList);
1285
+ }), catchError((error) => {
1286
+ return throwError(() => new Error(error));
1287
+ }));
1288
+ }
1289
+ /**
1290
+ * Fetches document status count data by application ID with optional context ID and category parameters.
1291
+ * @param {string} applicationId - The application ID to fetch status data.
1292
+ * @param {string | null} contextId - The context ID (applicant ID) to filter by. If null, uses applicationId.
1293
+ * @param {string | null} categoryId - The category ID to filter by.
1294
+ * @returns {Observable<StatusDataModel[]>} Observable that emits the status data.
1295
+ */
1296
+ getStatusDocumentCount(applicationId, contextId = null, categoryId = null) {
1297
+ if (!applicationId)
1298
+ return EMPTY;
1299
+ let url = `${this.apiUrl}${URLS.STATUS_DOCUMENT_COUNT}${applicationId}`;
1300
+ let params = new HttpParams();
1301
+ const contextParam = contextId || applicationId;
1302
+ params = params.set(SHARED.CONTEXT_ID, contextParam);
1303
+ if (categoryId) {
1304
+ params = params.set(SHARED.CATEGORY, categoryId);
1305
+ }
1306
+ return this.http.get(url, { params }).pipe(tap((statusData) => {
1307
+ this.documentStore.setStatusData(statusData);
1308
+ }), catchError((error) => {
1309
+ return throwError(() => new Error(error));
1310
+ }));
1311
+ }
1312
+ /**
1313
+ * Fetches documents based on selection criteria (menu item, user ID, status, and search key).
1163
1314
  * This method sends an HTTP GET request with query parameters for the selected filters.
1315
+ * @param {string} contextId - The context ID (applicationId or applicantId).
1164
1316
  * @param {string | null} menuItem - The selected menu item filter.
1165
1317
  * @param {string | null} userId - The selected user ID filter.
1166
1318
  * @param {string | null} status - The selected status filter.
1319
+ * @param {string | null} searchKey - The search key filter.
1167
1320
  * @returns {Observable<any>} An observable that emits the filtered document data.
1168
1321
  */
1169
- getDocumentsBySelection(menuItem, userId, status) {
1322
+ getDocumentsBySelection(contextId, menuItem, userId, status, searchKey = null) {
1170
1323
  let params = new HttpParams();
1171
1324
  if (menuItem) {
1172
- params = params.set('menuItem', menuItem);
1325
+ params = params.set(SHARED.CATEGORY, menuItem);
1173
1326
  }
1174
1327
  if (userId) {
1175
- params = params.set('userId', userId);
1328
+ params = params.set(SHARED.CONTEXT_ID, userId);
1176
1329
  }
1177
1330
  if (status) {
1178
- params = params.set('status', status);
1331
+ params = params.set(SHARED.STATUS_PARAM, status);
1179
1332
  }
1180
- return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/filter`, { params }).pipe(tap((response) => {
1181
- // Update the store with the filtered results
1333
+ if (searchKey) {
1334
+ params = params.set(SHARED.SEARCH_KEY, searchKey);
1335
+ }
1336
+ return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params }).pipe(tap((response) => {
1182
1337
  if (response.documents) {
1183
1338
  this.documentStore.setDocumentList(response.documents);
1184
1339
  }
@@ -1186,10 +1341,10 @@ class DocumentHttpService {
1186
1341
  return throwError(() => new Error(error));
1187
1342
  }));
1188
1343
  }
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 });
1190
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, providedIn: 'root' });
1344
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHttpService, deps: [{ token: DocumentStore }, { token: i2.HttpClient }, { token: AppConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
1345
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHttpService, providedIn: 'root' });
1191
1346
  }
1192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentHttpService, decorators: [{
1347
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHttpService, decorators: [{
1193
1348
  type: Injectable,
1194
1349
  args: [{
1195
1350
  providedIn: 'root'
@@ -1199,60 +1354,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
1199
1354
  /**
1200
1355
  * Service to manage the document data and selection state
1201
1356
  */
1202
- class DocumentService {
1357
+ class DocumentHelperService {
1203
1358
  documentStore;
1204
1359
  documentQuery;
1205
1360
  documentHttpService;
1206
- documentSubject$ = new BehaviorSubject(null);
1207
1361
  constructor(documentStore, documentQuery, documentHttpService) {
1208
1362
  this.documentStore = documentStore;
1209
1363
  this.documentQuery = documentQuery;
1210
1364
  this.documentHttpService = documentHttpService;
1211
- // Automatically call API when selection state changes
1212
- this.initializeSelectionWatcher();
1365
+ // Note: initializeSelectionWatcher now requires contextId
1366
+ // This should be called from the component that has access to contextId
1213
1367
  }
1214
1368
  /**
1215
1369
  * Initialize watcher for selection state changes
1370
+ * @param contextId - The context ID to use for API calls
1216
1371
  */
1217
- initializeSelectionWatcher() {
1218
- // Combine all selection observables and watch for changes
1372
+ initializeSelectionWatcher(contextId) {
1219
1373
  combineLatest([
1220
1374
  this.documentQuery.selectSelectedMenuItem(),
1221
1375
  this.documentQuery.selectSelectedUserId(),
1222
1376
  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 [];
1377
+ ]).pipe(debounceTime(300), distinctUntilChanged((prev, curr) => {
1378
+ const isSame = prev[0] === curr[0] && prev[1] === curr[1] && prev[2] === curr[2];
1379
+ console.log('Selection state changed:', { prev, curr, isSame });
1380
+ return isSame;
1381
+ }), switchMap(([menuItem, userId, status]) => {
1382
+ // Always call the API, even when filters are cleared
1383
+ return this.documentHttpService.getDocumentsBySelection(contextId, menuItem, userId, status);
1230
1384
  })).subscribe({
1231
1385
  next: (response) => {
1232
- console.log('API called with selection:', response);
1386
+ const currentState = this.documentQuery.getSelectionState();
1387
+ console.log('API called with filters:', {
1388
+ menuItem: currentState.menuItem,
1389
+ userId: currentState.userId,
1390
+ status: currentState.status
1391
+ });
1392
+ console.log('API response:', response);
1393
+ this.documentStore.setDocumentListResponse(response);
1233
1394
  },
1234
1395
  error: (error) => {
1235
1396
  console.error('Error calling API with selection:', error);
1236
1397
  }
1237
1398
  });
1238
1399
  }
1400
+ /**
1401
+ * Initialize watcher for selection state changes with initial load
1402
+ * @param contextId - The context ID to use for API calls
1403
+ */
1404
+ initializeSelectionWatcherWithInitialLoad(contextId) {
1405
+ // First, load initial data without filters
1406
+ this.documentHttpService.getDocumentsBySelection(contextId, null, null, null).subscribe({
1407
+ next: (response) => {
1408
+ console.log('Initial API call:', response);
1409
+ this.documentStore.setDocumentListResponse(response);
1410
+ },
1411
+ error: (error) => {
1412
+ console.error('Error calling initial API:', error);
1413
+ }
1414
+ });
1415
+ // Then set up the watcher for filter changes
1416
+ this.initializeSelectionWatcher(contextId);
1417
+ }
1239
1418
  /**
1240
1419
  * Set the document data
1241
1420
  * @param document the document data
1242
1421
  */
1243
1422
  set(document) {
1244
- this.documentSubject$.next(document);
1423
+ this.documentStore.setCurrentDocument(document);
1245
1424
  }
1246
1425
  /**
1247
1426
  * Get the document data
1248
1427
  * @returns the document data
1249
1428
  */
1250
1429
  get() {
1251
- return this.documentSubject$.asObservable();
1430
+ return this.documentQuery.selectCurrentDocument();
1431
+ }
1432
+ /**
1433
+ * Get the current document value synchronously
1434
+ * @returns the current document value
1435
+ */
1436
+ getValue() {
1437
+ return this.documentQuery.getCurrentDocument();
1252
1438
  }
1253
1439
  /**
1254
1440
  * Set the selected menu item
1255
- * @param menuItem the selected menu item
1441
+ * @param menuItem the selected menu item _id (not the label)
1256
1442
  */
1257
1443
  setSelectedMenuItem(menuItem) {
1258
1444
  this.documentStore.setSelectedMenuItem(menuItem);
@@ -1273,7 +1459,7 @@ class DocumentService {
1273
1459
  }
1274
1460
  /**
1275
1461
  * Set all selection state at once
1276
- * @param menuItem the selected menu item
1462
+ * @param menuItem the selected menu item _id (not the label)
1277
1463
  * @param userId the selected user ID
1278
1464
  * @param status the selected status
1279
1465
  */
@@ -1300,189 +1486,381 @@ class DocumentService {
1300
1486
  getSelectionState() {
1301
1487
  return this.documentQuery.selectSelectionState();
1302
1488
  }
1489
+ /**
1490
+ * Get observable for filtered documents
1491
+ * @returns Observable that emits filtered document responses
1492
+ */
1493
+ getFilteredDocuments() {
1494
+ return this.documentQuery.selectDocumentListResponse();
1495
+ }
1303
1496
  /**
1304
1497
  * Manually trigger API call with current selection state
1498
+ * @param contextId - The context ID to use for the API call
1305
1499
  */
1306
- refreshDocumentsWithCurrentSelection() {
1500
+ refreshDocumentsWithCurrentSelection(contextId) {
1307
1501
  const currentState = this.documentQuery.getSelectionState();
1308
- this.documentHttpService.getDocumentsBySelection(currentState.menuItem, currentState.userId, currentState.status).subscribe({
1502
+ console.log('Manual API refresh with state:', currentState);
1503
+ this.documentHttpService.getDocumentsBySelection(contextId, currentState.menuItem, currentState.userId, currentState.status).subscribe({
1504
+ next: (response) => {
1505
+ console.log('Manual API refresh response:', response);
1506
+ this.documentStore.setDocumentListResponse(response);
1507
+ },
1508
+ error: (error) => {
1509
+ throw new Error(error);
1510
+ }
1511
+ });
1512
+ }
1513
+ /**
1514
+ * Force refresh documents with no filters
1515
+ * @param contextId - The context ID to use for the API call
1516
+ */
1517
+ refreshDocumentsWithoutFilters(contextId) {
1518
+ console.log('Force refreshing documents without filters');
1519
+ this.documentHttpService.getDocumentsBySelection(contextId, null, null, null).subscribe({
1309
1520
  next: (response) => {
1310
- console.log('Manual API refresh:', response);
1521
+ console.log('Force refresh response:', response);
1522
+ this.documentStore.setDocumentListResponse(response);
1311
1523
  },
1312
1524
  error: (error) => {
1313
- console.error('Error in manual API refresh:', error);
1525
+ console.error('Error in force refresh:', error);
1314
1526
  }
1315
1527
  });
1316
1528
  }
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' });
1529
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1530
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, providedIn: 'root' });
1319
1531
  }
1320
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentService, decorators: [{
1532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHelperService, decorators: [{
1321
1533
  type: Injectable,
1322
1534
  args: [{
1323
1535
  providedIn: 'root',
1324
1536
  }]
1325
1537
  }], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentHttpService }] });
1326
1538
 
1327
- class UserListComponent {
1328
- documentService;
1539
+ class UserListService {
1329
1540
  documentStore;
1330
1541
  documentQuery;
1331
- userData = [];
1332
- selectedUser;
1333
- userSelected = new EventEmitter();
1334
- constructor(documentService, documentStore, documentQuery) {
1335
- this.documentService = documentService;
1542
+ constructor(documentStore, documentQuery) {
1336
1543
  this.documentStore = documentStore;
1337
1544
  this.documentQuery = documentQuery;
1338
1545
  }
1339
- ngOnInit() {
1340
- // Initialize user data with persistent colors and initials
1341
- this.userData = USERLIST.map((user, index) => ({
1546
+ getInitials(name) {
1547
+ return name.split(SHARED.EMPTY_SPACE).map(name => name.charAt(0)).join(SHARED.EMPTY).toUpperCase();
1548
+ }
1549
+ getColorByIndex(index) {
1550
+ const colors = SHARED.COLORS;
1551
+ return colors[index % colors.length];
1552
+ }
1553
+ getColorValue(colorName) {
1554
+ const colorMap = SHARED.COLOR_MAP;
1555
+ return colorMap[colorName] || SHARED.DEFAULT_COLOR;
1556
+ }
1557
+ processUserData(userList) {
1558
+ return userList.map((user, index) => ({
1342
1559
  ...user,
1343
- initials: this.getInitials(user.username),
1560
+ initials: this.getInitials(user.name),
1344
1561
  color: this.getColorByIndex(index)
1345
1562
  }));
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;
1563
+ }
1564
+ /**
1565
+ * Finds the selected menu item from categories
1566
+ * @param selectedMenuItemId - The ID of the selected menu item
1567
+ * @param categories - The document categories
1568
+ * @returns The selected menu item or null
1569
+ */
1570
+ findSelectedMenuItem(selectedMenuItemId, categories) {
1571
+ for (const category of categories) {
1572
+ if (category.items) {
1573
+ const item = category.items.find(item => item._id === selectedMenuItemId);
1574
+ if (item) {
1575
+ return item;
1576
+ }
1577
+ }
1578
+ }
1579
+ return null;
1580
+ }
1581
+ /**
1582
+ * Filters user list based on selected menu item category
1583
+ * @param userList - The complete user list
1584
+ * @param categories - The document categories
1585
+ * @returns Filtered user list
1586
+ */
1587
+ filterUsersByCategory(userList, categories) {
1588
+ const selectedMenuItemId = this.documentQuery.getSelectionState().menuItem;
1589
+ if (!selectedMenuItemId) {
1590
+ return userList;
1591
+ }
1592
+ const selectedMenuItem = this.findSelectedMenuItem(selectedMenuItemId, categories);
1593
+ if (!selectedMenuItem) {
1594
+ return userList;
1595
+ }
1596
+ const selectedCategory = categories.find(category => category.items?.some(item => item._id === selectedMenuItemId));
1597
+ if (!selectedCategory) {
1598
+ return userList;
1599
+ }
1600
+ if (selectedCategory.label === SHARED.APPLICATION) {
1601
+ return userList.filter(user => user.name === SHARED.APPLICATION_DOCS);
1602
+ }
1603
+ return userList;
1604
+ }
1605
+ selectUser(userId, userData) {
1606
+ const user = userData.find(u => u._id === userId);
1607
+ if (user) {
1608
+ this.documentStore.setSelectedUserId(userId);
1609
+ return { selectedUser: user.name, name: user.name };
1610
+ }
1611
+ return { selectedUser: undefined, name: undefined };
1612
+ }
1613
+ unselectUser() {
1614
+ this.documentStore.setSelectedUserId(null);
1615
+ }
1616
+ isUserSelected(userId, userData, selectedUser) {
1617
+ return selectedUser === userData.find(u => u._id === userId)?.name;
1618
+ }
1619
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserListService, deps: [{ token: DocumentStore }, { token: DocumentQuery }], target: i0.ɵɵFactoryTarget.Injectable });
1620
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserListService, providedIn: 'root' });
1621
+ }
1622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserListService, decorators: [{
1623
+ type: Injectable,
1624
+ args: [{
1625
+ providedIn: 'root'
1626
+ }]
1627
+ }], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }] });
1628
+
1629
+ class UserListComponent {
1630
+ documentService;
1631
+ documentStore;
1632
+ documentQuery;
1633
+ userListService;
1634
+ userList = SHARED.EMPTY_ARRAY;
1635
+ categories = SHARED.EMPTY_ARRAY;
1636
+ userSelected = new EventEmitter();
1637
+ userData = SHARED.EMPTY_ARRAY;
1638
+ filteredUserData = SHARED.EMPTY_ARRAY;
1639
+ selectedUser;
1640
+ shouldShowContainer = true;
1641
+ constructor(documentService, documentStore, documentQuery, userListService) {
1642
+ this.documentService = documentService;
1643
+ this.documentStore = documentStore;
1644
+ this.documentQuery = documentQuery;
1645
+ this.userListService = userListService;
1646
+ }
1647
+ ngOnChanges(changes) {
1648
+ if (changes['userList'] && !changes['userList'].firstChange) {
1649
+ this.initializeUserData();
1650
+ }
1651
+ }
1652
+ initializeUserData() {
1653
+ if (this.userList && this.userList.length > 0) {
1654
+ this.userData = this.userListService.processUserData(this.userList);
1655
+ this.updateFilteredUserData();
1656
+ }
1657
+ }
1658
+ updateFilteredUserData() {
1659
+ if (this.userData.length > 0 && this.categories.length > 0) {
1660
+ this.filteredUserData = this.userListService.filterUsersByCategory(this.userData, this.categories);
1661
+ this.shouldShowContainer = true;
1662
+ if (this.selectedUser) {
1663
+ const selectedUserInFiltered = this.filteredUserData.find(user => user.name === this.selectedUser);
1664
+ if (!selectedUserInFiltered) {
1665
+ this.selectedUser = undefined;
1666
+ this.documentStore.setSelectedUserId(null);
1667
+ this.userSelected.emit(SHARED.EMPTY);
1668
+ }
1669
+ }
1670
+ }
1671
+ else {
1672
+ this.filteredUserData = this.userData;
1673
+ this.shouldShowContainer = true;
1674
+ }
1675
+ }
1676
+ ngOnInit() {
1677
+ this.initializeUserData();
1678
+ this.documentQuery.selectSelectedUserId().subscribe(userId => {
1679
+ if (userId) {
1680
+ const user = this.userData.find(u => u._id === userId);
1681
+ this.selectedUser = user ? user.name : undefined;
1351
1682
  }
1352
1683
  else {
1353
1684
  this.selectedUser = undefined;
1354
1685
  }
1355
1686
  });
1356
- // Subscribe to user list visibility and reset selection when hidden
1687
+ this.documentQuery.selectSelectedMenuItem().subscribe(menuItemId => {
1688
+ this.updateFilteredUserData();
1689
+ if (this.selectedUser) {
1690
+ const selectedUserInFiltered = this.filteredUserData.find(user => user.name === this.selectedUser);
1691
+ if (!selectedUserInFiltered) {
1692
+ this.selectedUser = undefined;
1693
+ this.documentStore.setSelectedUserId(null);
1694
+ this.userSelected.emit(SHARED.EMPTY);
1695
+ }
1696
+ }
1697
+ });
1357
1698
  this.documentQuery.selectShowUserList().subscribe(show => {
1358
1699
  if (!show && this.selectedUser) {
1359
- // Reset user selection when user list is hidden
1360
1700
  this.selectedUser = undefined;
1361
- this.userSelected.emit('');
1701
+ this.userSelected.emit(SHARED.EMPTY);
1362
1702
  }
1363
1703
  });
1364
1704
  }
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
1705
  onUserSelect(username, id) {
1383
- // If the same user is clicked again, unselect it
1384
1706
  if (this.selectedUser === username) {
1385
1707
  this.selectedUser = undefined;
1386
- this.documentStore.setSelectedUserId(null);
1387
- this.userSelected.emit('');
1708
+ this.userListService.unselectUser();
1709
+ this.userSelected.emit(SHARED.EMPTY);
1388
1710
  }
1389
1711
  else {
1390
- // Select the new user
1391
1712
  this.selectedUser = username;
1392
1713
  this.documentStore.setSelectedUserId(id);
1393
1714
  this.userSelected.emit(username);
1394
1715
  }
1395
1716
  }
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"] }] });
1717
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserListComponent, deps: [{ token: DocumentHelperService }, { token: DocumentStore }, { token: DocumentQuery }, { token: UserListService }], target: i0.ɵɵFactoryTarget.Component });
1718
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: UserListComponent, isStandalone: false, selector: "lib-user-list", inputs: { userList: "userList", categories: "categories" }, outputs: { userSelected: "userSelected" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"user-list-container\" [@slideInFromTop]>\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of filteredUserData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.name\"\r\n [style.border-color]=\"selectedUser === user.name ? '#f97316' : 'transparent'\"\r\n (click)=\"onUserSelect(user.name, user._id)\"\r\n >\r\n <div class=\"user-avatar\" [ngClass]=\"'avatar-' + user.color\">\r\n <span class=\"initials\">{{ user.initials }}</span>\r\n </div>\r\n <div class=\"user-info\">\r\n <div class=\"username\">{{ user.name }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approved }} approved / {{ user.pending }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.name\" [@fadeIn]>\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n \r\n <div *ngIf=\"filteredUserData.length === 0 && shouldShowContainer\" class=\"no-users-message\" [@slideInFromTop]>\r\n <p>No users available for this category.</p>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem}.user-cards{display:flex;flex-wrap:wrap;gap:1rem;transition:all .3s ease-in-out}.user-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:330px;position:relative}.user-card:hover{box-shadow:0 4px 8px #00000026}.user-card.selected{background-color:#f8fafc;box-shadow:0 4px 8px #00000026;border-width:2px}.user-avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:14px}.avatar-orange{background-color:#f97316}.avatar-blue{background-color:#3b82f6}.avatar-green{background-color:#10b981}.avatar-grey{background-color:#6b7280}.avatar-purple{background-color:#8b5cf6}.user-info{flex:1}.username{font-weight:600;color:#1f2937;margin-bottom:.25rem}.document-counts{font-size:.875rem;color:#6b7280}.selection-indicator{position:absolute;top:8px;right:8px;width:20px;height:20px;background-color:#10b981;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px}.no-users-message{display:flex;justify-content:center;align-items:center;padding:2rem;background:#f8fafc;border-radius:8px;border:2px dashed #d1d5db;margin:1rem 0}.no-users-message p{color:#6b7280;font-size:.875rem;font-weight:500;margin:0;text-align:center}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
1719
+ trigger('slideInFromTop', [
1720
+ state('void', style({
1721
+ opacity: 0,
1722
+ transform: 'translateY(-10px)'
1723
+ })),
1724
+ state('*', style({
1725
+ opacity: 1,
1726
+ transform: 'translateY(0)'
1727
+ })),
1728
+ transition('void => *', [
1729
+ animate('300ms ease-out')
1730
+ ])
1731
+ ]),
1732
+ trigger('fadeIn', [
1733
+ state('void', style({
1734
+ opacity: 0,
1735
+ transform: 'scale(0.8)'
1736
+ })),
1737
+ state('*', style({
1738
+ opacity: 1,
1739
+ transform: 'scale(1)'
1740
+ })),
1741
+ transition('void => *', [
1742
+ animate('200ms ease-in-out')
1743
+ ])
1744
+ ])
1745
+ ] });
1417
1746
  }
1418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: UserListComponent, decorators: [{
1747
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: UserListComponent, decorators: [{
1419
1748
  type: Component,
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: [{
1749
+ args: [{ selector: 'lib-user-list', standalone: false, animations: [
1750
+ trigger('slideInFromTop', [
1751
+ state('void', style({
1752
+ opacity: 0,
1753
+ transform: 'translateY(-10px)'
1754
+ })),
1755
+ state('*', style({
1756
+ opacity: 1,
1757
+ transform: 'translateY(0)'
1758
+ })),
1759
+ transition('void => *', [
1760
+ animate('300ms ease-out')
1761
+ ])
1762
+ ]),
1763
+ trigger('fadeIn', [
1764
+ state('void', style({
1765
+ opacity: 0,
1766
+ transform: 'scale(0.8)'
1767
+ })),
1768
+ state('*', style({
1769
+ opacity: 1,
1770
+ transform: 'scale(1)'
1771
+ })),
1772
+ transition('void => *', [
1773
+ animate('200ms ease-in-out')
1774
+ ])
1775
+ ])
1776
+ ], template: "<div class=\"user-list-container\" [@slideInFromTop]>\r\n <div class=\"user-cards\">\r\n <div \r\n *ngFor=\"let user of filteredUserData\" \r\n class=\"user-card\"\r\n [class.selected]=\"selectedUser === user.name\"\r\n [style.border-color]=\"selectedUser === user.name ? '#f97316' : 'transparent'\"\r\n (click)=\"onUserSelect(user.name, user._id)\"\r\n >\r\n <div class=\"user-avatar\" [ngClass]=\"'avatar-' + user.color\">\r\n <span class=\"initials\">{{ user.initials }}</span>\r\n </div>\r\n <div class=\"user-info\">\r\n <div class=\"username\">{{ user.name }}</div>\r\n <div class=\"document-counts\">\r\n {{ user.approved }} approved / {{ user.pending }} pending\r\n </div>\r\n </div>\r\n <div class=\"selection-indicator\" *ngIf=\"selectedUser === user.name\" [@fadeIn]>\r\n <i class=\"ri-check-line\"></i>\r\n </div>\r\n </div>\r\n \r\n <div *ngIf=\"filteredUserData.length === 0 && shouldShowContainer\" class=\"no-users-message\" [@slideInFromTop]>\r\n <p>No users available for this category.</p>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".user-list-container{padding:1rem}.user-cards{display:flex;flex-wrap:wrap;gap:1rem;transition:all .3s ease-in-out}.user-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:330px;position:relative}.user-card:hover{box-shadow:0 4px 8px #00000026}.user-card.selected{background-color:#f8fafc;box-shadow:0 4px 8px #00000026;border-width:2px}.user-avatar{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:14px}.avatar-orange{background-color:#f97316}.avatar-blue{background-color:#3b82f6}.avatar-green{background-color:#10b981}.avatar-grey{background-color:#6b7280}.avatar-purple{background-color:#8b5cf6}.user-info{flex:1}.username{font-weight:600;color:#1f2937;margin-bottom:.25rem}.document-counts{font-size:.875rem;color:#6b7280}.selection-indicator{position:absolute;top:8px;right:8px;width:20px;height:20px;background-color:#10b981;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px}.no-users-message{display:flex;justify-content:center;align-items:center;padding:2rem;background:#f8fafc;border-radius:8px;border:2px dashed #d1d5db;margin:1rem 0}.no-users-message p{color:#6b7280;font-size:.875rem;font-weight:500;margin:0;text-align:center}\n"] }]
1777
+ }], ctorParameters: () => [{ type: DocumentHelperService }, { type: DocumentStore }, { type: DocumentQuery }, { type: UserListService }], propDecorators: { userList: [{
1778
+ type: Input
1779
+ }], categories: [{
1780
+ type: Input
1781
+ }], userSelected: [{
1422
1782
  type: Output
1423
1783
  }] } });
1424
1784
 
1785
+ class StatusCalculatorService {
1786
+ calculateTotalCount(statusData) {
1787
+ return statusData?.reduce((total, status) => total + (status.count ?? 0), 0) || 0;
1788
+ }
1789
+ calculateStatusDataWithPercentages(statusData, selectedStatusId) {
1790
+ if (!statusData)
1791
+ return [];
1792
+ const totalCount = this.calculateTotalCount(statusData);
1793
+ return statusData.map((status) => ({
1794
+ ...status,
1795
+ percentage: totalCount > 0 ? (status.count ?? 0) / totalCount * 100 : 0,
1796
+ isSelected: selectedStatusId === status._id,
1797
+ statusClass: status.status ? SHARED.STATUS_WITH_DASH + status.status.toLowerCase() : SHARED.EMPTY,
1798
+ iconClass: SHARED.ICON_WITH_DASH + (status?.status?.toLowerCase() || SHARED.EMPTY)
1799
+ }));
1800
+ }
1801
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StatusCalculatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1802
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StatusCalculatorService, providedIn: 'root' });
1803
+ }
1804
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: StatusCalculatorService, decorators: [{
1805
+ type: Injectable,
1806
+ args: [{
1807
+ providedIn: 'root'
1808
+ }]
1809
+ }] });
1810
+
1425
1811
  class DocumentStatusComponent {
1426
- documentStore;
1427
1812
  documentQuery;
1428
1813
  documentService;
1429
- statusData = SAMPLE_STATUS_DATA;
1430
- selectedStatus = null;
1814
+ statusCalculatorService;
1815
+ contextId = SHARED.EMPTY;
1816
+ statusData;
1817
+ selectedStatusId = null;
1818
+ statusDataWithPercentages = [];
1431
1819
  subscription = new Subscription();
1432
- constructor(documentStore, documentQuery, documentService) {
1433
- this.documentStore = documentStore;
1820
+ constructor(documentQuery, documentService, statusCalculatorService) {
1434
1821
  this.documentQuery = documentQuery;
1435
1822
  this.documentService = documentService;
1823
+ this.statusCalculatorService = statusCalculatorService;
1436
1824
  }
1437
1825
  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);
1826
+ // Retrieve data from services
1827
+ this.subscription.add(this.documentQuery.selectSelectedStatus().subscribe(statusId => {
1828
+ this.selectedStatusId = statusId;
1829
+ this.updateCalculatedStatusData();
1442
1830
  }));
1443
- // Subscribe to all selection state changes
1444
- this.subscription.add(this.documentService.getSelectionState().subscribe(selectionState => {
1445
- console.log('Current selection state:', selectionState);
1831
+ this.subscription.add(this.documentQuery.selectStatusData().subscribe(statusData => {
1832
+ if (statusData && statusData.length > 0) {
1833
+ this.statusData = statusData;
1834
+ this.updateCalculatedStatusData();
1835
+ }
1446
1836
  }));
1447
1837
  }
1448
1838
  ngOnDestroy() {
1449
1839
  this.subscription.unsubscribe();
1450
1840
  }
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);
1841
+ // Handle event from template
1842
+ selectStatus(statusId) {
1843
+ const newStatusId = this.selectedStatusId === statusId ? null : statusId;
1844
+ this.documentService.setSelectedStatus(newStatusId);
1461
1845
  }
1462
- isSelected(status) {
1463
- const isSelected = this.selectedStatus === status;
1464
- return isSelected;
1846
+ updateCalculatedStatusData() {
1847
+ this.statusDataWithPercentages = this.statusCalculatorService.calculateStatusDataWithPercentages(this.statusData, this.selectedStatusId);
1465
1848
  }
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"] }] });
1849
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStatusComponent, deps: [{ token: DocumentQuery }, { token: DocumentHelperService }, { token: StatusCalculatorService }], target: i0.ɵɵFactoryTarget.Component });
1850
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentStatusComponent, isStandalone: false, selector: "lib-document-status", inputs: { contextId: "contextId", statusData: "statusData" }, ngImport: i0, template: "<div class=\"status-summary-container\">\r\n <div class=\"status-cards\">\r\n \r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"status-card {{ status.statusClass }}\"\r\n [class.selected]=\"status.isSelected\"\r\n (click)=\"selectStatus(status._id || '')\"\r\n >\r\n <div class=\"status-icon {{ status.iconClass }}\">\r\n <i [class]=\"status.icon\"></i>\r\n </div>\r\n <div class=\"status-info\">\r\n <div class=\"status-count\">{{ status.count }}</div>\r\n <div class=\"status-name\">{{ status.status }}</div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div class=\"progress-bar-container\">\r\n <div class=\"progress-bar\">\r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"progress-segment\"\r\n [style.width.%]=\"status.percentage\"\r\n [style.background-color]=\"status.color\"\r\n ></div>\r\n </div>\r\n </div>\r\n</div>", styles: [".status-summary-container{padding:1rem}.status-cards{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}.status-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border-radius:8px;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:150px;flex:1;cursor:pointer;transition:all .2s ease;border:2px solid transparent}.status-card:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.status-card.selected{border-width:3px!important;border-style:solid!important;box-shadow:0 4px 12px #0003}.status-card.selected.status-approved{border-color:#10b981!important;background:#ecfdf5!important}.status-card.selected.status-pending{border-color:#6b7280!important;background:#f8fafc!important}.status-card.selected.status-reviewing{border-color:#f59e0b!important;background:#fffbeb!important}.status-card.selected.status-rejected{border-color:#ef4444!important;background:#fff1f2!important}.status-card.selected.status-alert{border-color:#dc2626!important;background:#ef4444!important}.status-icon{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff}.icon-approved{background-color:#10b981}.icon-pending{background-color:#6b7280}.icon-reviewing{background-color:#f59e0b}.icon-rejected{background-color:#ef4444}.icon-alert{background-color:#dc2626}.status-info{flex:1}.status-name{font-weight:600;color:#1f2937;margin-bottom:.25rem}.status-count{font-size:1.5rem;font-weight:700;color:#374151}.progress-bar-container{margin-top:1rem}.progress-bar{height:8px;background-color:#e5e7eb;border-radius:4px;overflow:hidden;display:flex}.progress-segment{height:100%;transition:width .3s ease}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1476
1851
  }
1477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentStatusComponent, decorators: [{
1852
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentStatusComponent, decorators: [{
1478
1853
  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 }] });
1854
+ args: [{ selector: 'lib-document-status', standalone: false, template: "<div class=\"status-summary-container\">\r\n <div class=\"status-cards\">\r\n \r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"status-card {{ status.statusClass }}\"\r\n [class.selected]=\"status.isSelected\"\r\n (click)=\"selectStatus(status._id || '')\"\r\n >\r\n <div class=\"status-icon {{ status.iconClass }}\">\r\n <i [class]=\"status.icon\"></i>\r\n </div>\r\n <div class=\"status-info\">\r\n <div class=\"status-count\">{{ status.count }}</div>\r\n <div class=\"status-name\">{{ status.status }}</div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div class=\"progress-bar-container\">\r\n <div class=\"progress-bar\">\r\n <div \r\n *ngFor=\"let status of statusDataWithPercentages\" \r\n class=\"progress-segment\"\r\n [style.width.%]=\"status.percentage\"\r\n [style.background-color]=\"status.color\"\r\n ></div>\r\n </div>\r\n </div>\r\n</div>", styles: [".status-summary-container{padding:1rem}.status-cards{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:1.5rem}.status-card{display:flex;align-items:center;gap:.75rem;padding:1rem;border-radius:8px;background:#fff;box-shadow:0 2px 4px #0000001a;min-width:150px;flex:1;cursor:pointer;transition:all .2s ease;border:2px solid transparent}.status-card:hover{transform:translateY(-2px);box-shadow:0 4px 8px #00000026}.status-card.selected{border-width:3px!important;border-style:solid!important;box-shadow:0 4px 12px #0003}.status-card.selected.status-approved{border-color:#10b981!important;background:#ecfdf5!important}.status-card.selected.status-pending{border-color:#6b7280!important;background:#f8fafc!important}.status-card.selected.status-reviewing{border-color:#f59e0b!important;background:#fffbeb!important}.status-card.selected.status-rejected{border-color:#ef4444!important;background:#fff1f2!important}.status-card.selected.status-alert{border-color:#dc2626!important;background:#ef4444!important}.status-icon{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff}.icon-approved{background-color:#10b981}.icon-pending{background-color:#6b7280}.icon-reviewing{background-color:#f59e0b}.icon-rejected{background-color:#ef4444}.icon-alert{background-color:#dc2626}.status-info{flex:1}.status-name{font-weight:600;color:#1f2937;margin-bottom:.25rem}.status-count{font-size:1.5rem;font-weight:700;color:#374151}.progress-bar-container{margin-top:1rem}.progress-bar{height:8px;background-color:#e5e7eb;border-radius:4px;overflow:hidden;display:flex}.progress-segment{height:100%;transition:width .3s ease}\n"] }]
1855
+ }], ctorParameters: () => [{ type: DocumentQuery }, { type: DocumentHelperService }, { type: StatusCalculatorService }], propDecorators: { contextId: [{
1856
+ type: Input
1857
+ }], statusData: [{
1858
+ type: Input
1859
+ }] } });
1481
1860
 
1482
1861
  /**
1483
1862
  * The `FolderContainerComponent` is responsible for rendering a container
1484
1863
  * that displays a list of documents and associated folder panel data.
1485
- *
1486
1864
  * This component utilizes the `FOLDERPANEL` constant for folder panel data
1487
1865
  * and accepts a document list input of type `DocumentModel`.
1488
1866
  */
@@ -1503,85 +1881,146 @@ class FolderContainerComponent {
1503
1881
  * @type {string}
1504
1882
  */
1505
1883
  contextId = SHARED.EMPTY;
1884
+ /**
1885
+ * The list of users passed as input to the component.
1886
+ * @type {UserListModel[]}
1887
+ */
1888
+ userList = [];
1889
+ /**
1890
+ * The status data passed as input to the component.
1891
+ * @type {StatusDataModel[]}
1892
+ */
1893
+ statusData = [];
1894
+ /**
1895
+ * The document categories passed as input to the component.
1896
+ * @type {DocumentCategory[]}
1897
+ */
1898
+ categories = [];
1506
1899
  /**
1507
1900
  * Flag to control user list visibility
1508
1901
  */
1509
1902
  showUserList = true;
1903
+ /**
1904
+ * Animation state for user list visibility
1905
+ */
1906
+ userListAnimationState = SHARED.VISIBLE;
1510
1907
  constructor(documentQuery) {
1511
1908
  this.documentQuery = documentQuery;
1512
1909
  }
1513
1910
  ngOnInit() {
1514
- // Subscribe to user list visibility state
1515
1911
  this.documentQuery.selectShowUserList().subscribe(show => {
1516
1912
  this.showUserList = show;
1913
+ this.userListAnimationState = show ? SHARED.VISIBLE : SHARED.HIDDEN;
1517
1914
  });
1518
1915
  }
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: [
1916
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderContainerComponent, deps: [{ token: DocumentQuery }], target: i0.ɵɵFactoryTarget.Component });
1917
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderContainerComponent, isStandalone: false, selector: "lib-folder-container", inputs: { documentList: "documentList", folderList: "folderList", contextId: "contextId", userList: "userList", statusData: "statusData", categories: "categories" }, ngImport: i0, template: "\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\r\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\r\n</div>\r\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: UserListComponent, selector: "lib-user-list", inputs: ["userList", "categories"], outputs: ["userSelected"] }, { kind: "component", type: DocumentStatusComponent, selector: "lib-document-status", inputs: ["contextId", "statusData"] }], animations: [
1527
1918
  trigger('slideInOut', [
1528
1919
  state('visible', style({
1529
- maxHeight: '600px',
1920
+ height: '*',
1530
1921
  opacity: 1,
1531
1922
  transform: 'translateY(0)',
1532
1923
  overflow: 'hidden',
1533
- marginBottom: '1rem'
1924
+ marginBottom: '1rem',
1925
+ visibility: 'visible'
1534
1926
  })),
1535
1927
  state('hidden', style({
1536
- maxHeight: '0px',
1928
+ height: '0px',
1537
1929
  opacity: 0,
1538
- transform: 'translateY(-30px)',
1930
+ transform: 'translateY(-20px)',
1539
1931
  overflow: 'hidden',
1540
- marginBottom: '0px'
1932
+ marginBottom: '0px',
1933
+ visibility: 'hidden'
1541
1934
  })),
1542
1935
  transition('visible => hidden', [
1543
- animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
1936
+ animate('250ms cubic-bezier(0.4, 0.0, 0.2, 1)')
1544
1937
  ]),
1545
1938
  transition('hidden => visible', [
1546
- animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
1939
+ animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)')
1547
1940
  ])
1548
1941
  ])
1549
1942
  ] });
1550
1943
  }
1551
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderContainerComponent, decorators: [{
1944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderContainerComponent, decorators: [{
1552
1945
  type: Component,
1553
1946
  args: [{ selector: 'lib-folder-container', standalone: false, animations: [
1554
1947
  trigger('slideInOut', [
1555
1948
  state('visible', style({
1556
- maxHeight: '600px',
1949
+ height: '*',
1557
1950
  opacity: 1,
1558
1951
  transform: 'translateY(0)',
1559
1952
  overflow: 'hidden',
1560
- marginBottom: '1rem'
1953
+ marginBottom: '1rem',
1954
+ visibility: 'visible'
1561
1955
  })),
1562
1956
  state('hidden', style({
1563
- maxHeight: '0px',
1957
+ height: '0px',
1564
1958
  opacity: 0,
1565
- transform: 'translateY(-30px)',
1959
+ transform: 'translateY(-20px)',
1566
1960
  overflow: 'hidden',
1567
- marginBottom: '0px'
1961
+ marginBottom: '0px',
1962
+ visibility: 'hidden'
1568
1963
  })),
1569
1964
  transition('visible => hidden', [
1570
- animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
1965
+ animate('250ms cubic-bezier(0.4, 0.0, 0.2, 1)')
1571
1966
  ]),
1572
1967
  transition('hidden => visible', [
1573
- animate('400ms cubic-bezier(0.4, 0.0, 0.2, 1)')
1968
+ animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)')
1574
1969
  ])
1575
1970
  ])
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"] }]
1971
+ ], template: "\r\n<div class=\"user-list-wrapper\" [@slideInOut]=\"userListAnimationState\">\r\n <lib-user-list [userList]=\"userList\" [categories]=\"categories\"></lib-user-list>\r\n</div>\r\n<lib-document-status [contextId]=\"contextId\" [statusData]=\"statusData\"></lib-document-status>", styles: [".user-list-wrapper{overflow:hidden;margin-bottom:1rem}.user-list-wrapper ::ng-deep *{transition:opacity .2s ease-in-out}.user-list-wrapper.ng-animating{pointer-events:none}::ng-deep lib-user-list{display:block;width:100%}\n"] }]
1577
1972
  }], ctorParameters: () => [{ type: DocumentQuery }], propDecorators: { documentList: [{
1578
1973
  type: Input
1579
1974
  }], folderList: [{
1580
1975
  type: Input
1581
1976
  }], contextId: [{
1582
1977
  type: Input
1978
+ }], userList: [{
1979
+ type: Input
1980
+ }], statusData: [{
1981
+ type: Input
1982
+ }], categories: [{
1983
+ type: Input
1583
1984
  }] } });
1584
1985
 
1986
+ /**
1987
+ * A utility class containing common error messages.
1988
+ * @class ERRORS
1989
+ */
1990
+ class ERRORS {
1991
+ /**
1992
+ * Error message for invalid recipient.
1993
+ * @static
1994
+ * @type {string}
1995
+ */
1996
+ static INVALID_RECIPIENT = "Invalid recipient: The recipient cannot be empty.";
1997
+ /**
1998
+ * Error message for invalid document.
1999
+ * @static
2000
+ * @type {string}
2001
+ */
2002
+ static ERROR_FETCHING_DOCUMENTS = "Error fetching documents:";
2003
+ /**
2004
+ * Error message for invalid document.
2005
+ * @static
2006
+ * @type {string}
2007
+ */
2008
+ static ERROR_FETCHING_FOLDERS = "Error fetching folders:";
2009
+ /**
2010
+ * Error message for invalid document.
2011
+ * @static
2012
+ * @type {string}
2013
+ */
2014
+ static ERROR_ALLDOCUMENT_MISSING = "allDocumentTypes is missing in the response:";
2015
+ /**
2016
+ * Error message for invalid document.
2017
+ * @static
2018
+ * @type {string}
2019
+ */
2020
+ static ERROR_DOCUMENT_TYPES = "Error fetching document types:";
2021
+ static ERROR_DOCUMENT_CATAGORY = 'Error fetching document categories:';
2022
+ }
2023
+
1585
2024
  /**
1586
2025
  * Storing all permission properties.
1587
2026
  * @export
@@ -1710,35 +2149,46 @@ class DocumentUploadService {
1710
2149
  return null;
1711
2150
  }
1712
2151
  }
1713
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadService, deps: [{ token: DocumentService$1 }, { token: DocumentStore }, { token: i3.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
1714
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadService, providedIn: 'root' });
2152
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadService, deps: [{ token: DocumentService }, { token: DocumentStore }, { token: i3.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
2153
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadService, providedIn: 'root' });
1715
2154
  }
1716
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadService, decorators: [{
2155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadService, decorators: [{
1717
2156
  type: Injectable,
1718
2157
  args: [{
1719
2158
  providedIn: 'root'
1720
2159
  }]
1721
- }], ctorParameters: () => [{ type: DocumentService$1 }, { type: DocumentStore }, { type: i3.MessageService }] });
2160
+ }], ctorParameters: () => [{ type: DocumentService }, { type: DocumentStore }, { type: i3.MessageService }] });
1722
2161
 
1723
2162
  class DocumentTableBuilderService {
1724
2163
  constructor() { }
1725
2164
  /**
1726
- * Builds table data for document sections
1727
- * @param sections Array of document sections
2165
+ * Gets document type from file name extension
2166
+ * @param fileName File name with extension
2167
+ * @returns Document type string
2168
+ */
2169
+ getDocumentTypeFromFileName(fileName) {
2170
+ if (!fileName)
2171
+ return '';
2172
+ const extension = fileName.split('.').pop()?.toUpperCase();
2173
+ return extension || '';
2174
+ }
2175
+ /**
2176
+ * Builds table data for document categories
2177
+ * @param categories Array of document categories
1728
2178
  * @returns Array of TableData objects
1729
2179
  */
1730
- buildDocumentSectionsTables(sections) {
1731
- return sections.map(section => this.buildTableForSection(section));
2180
+ buildDocumentCategoriesTables(categories) {
2181
+ return categories.map(category => this.buildTableForCategory(category));
1732
2182
  }
1733
2183
  /**
1734
- * Builds table data for a single document section
1735
- * @param section Document section
2184
+ * Builds table data for a single document category
2185
+ * @param category Document category
1736
2186
  * @returns TableData object
1737
2187
  */
1738
- buildTableForSection(section) {
2188
+ buildTableForCategory(category) {
1739
2189
  const columns = [
1740
2190
  {
1741
- field: 'documentName',
2191
+ field: 'docName',
1742
2192
  header: 'Document',
1743
2193
  type: 'document',
1744
2194
  width: '35%'
@@ -1750,13 +2200,13 @@ class DocumentTableBuilderService {
1750
2200
  width: '15%'
1751
2201
  },
1752
2202
  {
1753
- field: 'applicantName',
1754
- header: 'Applicant',
2203
+ field: 'ownerName',
2204
+ header: 'Owner',
1755
2205
  type: 'text',
1756
2206
  width: '20%'
1757
2207
  },
1758
2208
  {
1759
- field: 'uploadedTime',
2209
+ field: 'uploadedOn',
1760
2210
  header: 'Uploaded',
1761
2211
  type: 'text',
1762
2212
  width: '15%'
@@ -1770,18 +2220,18 @@ class DocumentTableBuilderService {
1770
2220
  ];
1771
2221
  return {
1772
2222
  columns: columns,
1773
- data: section.list
2223
+ data: category.list
1774
2224
  };
1775
2225
  }
1776
2226
  /**
1777
- * Builds a single table from document list
1778
- * @param documents Array of document items
2227
+ * Builds a single table from document list items
2228
+ * @param documents Array of document list items
1779
2229
  * @returns TableData object
1780
2230
  */
1781
2231
  buildDocumentTable(documents) {
1782
2232
  const columns = [
1783
2233
  {
1784
- field: 'documentName',
2234
+ field: 'docName',
1785
2235
  header: 'Document',
1786
2236
  type: 'document',
1787
2237
  width: '35%'
@@ -1793,13 +2243,13 @@ class DocumentTableBuilderService {
1793
2243
  width: '15%'
1794
2244
  },
1795
2245
  {
1796
- field: 'applicantName',
1797
- header: 'Applicant',
2246
+ field: 'ownerName',
2247
+ header: 'Owner',
1798
2248
  type: 'text',
1799
2249
  width: '20%'
1800
2250
  },
1801
2251
  {
1802
- field: 'uploadedTime',
2252
+ field: 'uploadedOn',
1803
2253
  header: 'Uploaded',
1804
2254
  type: 'text',
1805
2255
  width: '15%'
@@ -1817,35 +2267,53 @@ class DocumentTableBuilderService {
1817
2267
  };
1818
2268
  }
1819
2269
  /**
1820
- * Gets completion count for a section
1821
- * @param section Document section
2270
+ * Gets completion count for a category
2271
+ * @param category Document category
1822
2272
  * @returns Completion string (e.g., "2/4")
1823
2273
  */
1824
- getCompletionCount(section) {
1825
- const total = section.list.length;
1826
- const completed = section.list.filter(doc => doc.status.toLowerCase() === 'approved' ||
2274
+ getCompletionCount(category) {
2275
+ const total = category.list.length;
2276
+ const completed = category.list.filter(doc => doc.status.toLowerCase() === 'approved' ||
1827
2277
  doc.status.toLowerCase() === 'uploaded').length;
1828
2278
  return `${completed}/${total}`;
1829
2279
  }
1830
2280
  /**
1831
- * Transforms document model to document item
2281
+ * Gets pending document count for a category
2282
+ * @param category Document category
2283
+ * @returns Number of pending documents
2284
+ */
2285
+ getPendingDocumentCount(category) {
2286
+ return category.totalDocs - category.acceptedDocs;
2287
+ }
2288
+ /**
2289
+ * Gets approved document count for a category
2290
+ * @param category Document category
2291
+ * @returns Number of approved documents
2292
+ */
2293
+ getApprovedDocumentCount(category) {
2294
+ return category.acceptedDocs;
2295
+ }
2296
+ /**
2297
+ * Transforms document model to document list item
1832
2298
  * @param documents Array of DocumentModel
1833
- * @returns Array of DocumentItem
2299
+ * @returns Array of DocumentListItem
1834
2300
  */
1835
- transformDocumentModelToItem(documents) {
2301
+ transformDocumentModelToListItem(documents) {
1836
2302
  return documents.map(doc => ({
1837
- documentName: doc.fileName || doc.documentName || '',
1838
- documentType: doc.documentType || doc.type || '',
2303
+ _id: doc._id || '',
2304
+ fileName: doc.fileName || '',
2305
+ docName: doc.docName || doc.documentName || '',
2306
+ fileSize: doc.fileSize || '',
1839
2307
  documentUrl: doc.documentUrl || doc.url || '',
1840
2308
  status: doc.status || 'Pending',
1841
- applicantName: doc.applicantName || doc.applicant || '',
1842
- uploadedTime: doc.uploadedTime || doc.uploadDate || ''
2309
+ uploadedOn: doc.uploadedOn || doc.uploadDate || '',
2310
+ ownerName: doc.ownerName || doc.applicantName || ''
1843
2311
  }));
1844
2312
  }
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' });
2313
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentTableBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2314
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentTableBuilderService, providedIn: 'root' });
1847
2315
  }
1848
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentTableBuilderService, decorators: [{
2316
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentTableBuilderService, decorators: [{
1849
2317
  type: Injectable,
1850
2318
  args: [{
1851
2319
  providedIn: 'root'
@@ -1856,6 +2324,7 @@ class TablePrimaryComponent {
1856
2324
  tableData = { columns: [], data: [] };
1857
2325
  showHeader = true;
1858
2326
  tableStyle = { 'min-width': '100%' };
2327
+ rowClick = new EventEmitter();
1859
2328
  // Helper methods for document table
1860
2329
  getStatusClass(status) {
1861
2330
  switch (status.toLowerCase()) {
@@ -1893,12 +2362,6 @@ class TablePrimaryComponent {
1893
2362
  return 'pi pi-clock';
1894
2363
  }
1895
2364
  }
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
2365
  getFileExtension(fileName) {
1903
2366
  return fileName.split('.').pop()?.toUpperCase() || 'PDF';
1904
2367
  }
@@ -1907,18 +2370,23 @@ class TablePrimaryComponent {
1907
2370
  // Handle action menu click - can be extended with menu functionality
1908
2371
  console.log('Action clicked for document:', rowData);
1909
2372
  }
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]" }] });
2373
+ onRowClick(rowData) {
2374
+ this.rowClick.emit(rowData);
2375
+ }
2376
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePrimaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2377
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TablePrimaryComponent, isStandalone: false, selector: "lib-table-primary", inputs: { tableData: "tableData", showHeader: "showHeader", tableStyle: "tableStyle" }, outputs: { rowClick: "rowClick" }, ngImport: i0, template: "<div class=\"card\">\n <p-table [value]=\"tableData.data\" [tableStyle]=\"tableStyle\">\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\n <tr>\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\n {{ col.header }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData>\n <tr (click)=\"onRowClick(rowData)\" class=\"clickable-row\">\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\n <!-- Document Cell -->\n <div *ngIf=\"col.type === 'document'\" class=\"document-cell\">\n <div class=\"document-info\">\n <div class=\"document-icon\">\n <i class=\"pi pi-file-pdf\" *ngIf=\"getFileExtension(rowData.fileName) === 'PDF'\"></i>\n <i class=\"pi pi-image\" *ngIf=\"getFileExtension(rowData.fileName) === 'JPG' || getFileExtension(rowData.fileName) === 'PNG'\"></i>\n <i class=\"pi pi-file-excel\" *ngIf=\"getFileExtension(rowData.fileName) === 'XLSX'\"></i>\n <i class=\"pi pi-file\" *ngIf=\"getFileExtension(rowData.fileName) !== 'PDF' && getFileExtension(rowData.fileName) !== 'JPG' && getFileExtension(rowData.fileName) !== 'PNG' && getFileExtension(rowData.fileName) !== 'XLSX'\"></i>\n </div>\n <div class=\"document-details\">\n <div class=\"document-name\">{{ rowData.docName }}</div>\n <div class=\"file-info\">{{ rowData.fileName }} - {{ rowData.fileSize }}</div>\n </div>\n </div>\n </div>\n\n <!-- Status Cell -->\n \n <div *ngIf=\"col.type === 'status'\" class=\"status-cell\">\n <span class=\"status-pill\" [ngClass]=\"getStatusClass(rowData[col.field])\">\n <i [class]=\"getStatusIcon(rowData[col.field])\"></i>\n {{ rowData[col.field] }}\n </span>\n </div>\n\n <!-- Actions Cell -->\n <div *ngIf=\"col.type === 'actions'\" class=\"actions-cell\">\n <button pButton pRipple type=\"button\" icon=\"ri-delete-bin-6-line\" \n class=\"p-button-text p-button-rounded\" \n (click)=\"onActionClick($event, rowData)\">\n </button>\n </div>\n\n <!-- Default Text Cell -->\n <div *ngIf=\"!col.type || col.type === 'text'\" class=\"text-cell\">\n {{ rowData[col.field] }}\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>", styles: [".document-cell .document-info{display:flex;align-items:center;gap:.75rem;text-align:left}.document-cell .document-info .document-icon{width:40px;height:40px;background-color:#e3f2fd;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#1976d2;font-size:1.25rem;flex-shrink:0}.document-cell .document-info .document-details{flex:1;min-width:0}.document-cell .document-info .document-details .document-name{font-weight:400;color:#334155;line-height:20px;font-size:14px;margin-bottom:.25rem;text-align:left}.document-cell .document-info .document-details .file-info{font-size:.75rem;color:#6c757d;text-align:left}.status-cell .status-pill{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .75rem;border-radius:20px;font-size:.75rem;font-weight:500;white-space:nowrap;min-width:80px}.status-cell .status-pill i{font-size:.875rem}.status-cell .status-pill.status-pending{background-color:#f3f4f6;color:#6b7280}.status-cell .status-pill.status-approved{background-color:#d1fae5;color:#065f46}.status-cell .status-pill.status-alert{background-color:#fee2e2;color:#dc2626}.status-cell .status-pill.status-uploaded{background-color:#dbeafe;color:#1d4ed8}.status-cell .status-pill.status-reviewing{background-color:#fef3c7;color:#d97706}.status-cell .status-pill.status-rejected{background-color:#fee2e2;color:#dc2626}.actions-cell{text-align:left}.actions-cell .p-button{width:2rem;height:2rem;border-radius:50%;background-color:transparent;border:none;color:#6c757d}.actions-cell .p-button:hover{background-color:#f8f9fa;color:#495057}.text-cell{font-weight:500;color:#475569;font-size:14px;line-height:20px;text-align:left}.clickable-row{cursor:pointer;transition:background-color .2s ease}.clickable-row:hover{background-color:#f8f9fa!important}.clickable-row:active{background-color:#e9ecef!important}::ng-deep .p-datatable .p-datatable-wrapper{border:1px solid #E2E8F0;border-radius:10px}::ng-deep .p-datatable .p-datatable-thead>tr>th{background-color:#f8f9fa;border:none;border-bottom:1px solid #dee2e6;padding:1rem 1.5rem;font-weight:600;color:#64748b;font-size:.875rem;text-transform:capitalize;letter-spacing:.5px;text-align:left;border-radius:8px 8px 0 0}::ng-deep .p-datatable .p-datatable-thead>tr>th:first-child{border-top-left-radius:8px}::ng-deep .p-datatable .p-datatable-thead>tr>th:last-child{border-top-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr{border-bottom:1px solid #f1f3f4}::ng-deep .p-datatable .p-datatable-tbody>tr:hover{background-color:#f8f9fa}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr>td{border:none;padding:1rem 1.5rem;vertical-align:middle;text-align:left}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: 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$1.Ripple, selector: "[pRipple]" }] });
1912
2378
  }
1913
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TablePrimaryComponent, decorators: [{
2379
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePrimaryComponent, decorators: [{
1914
2380
  type: Component,
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"] }]
2381
+ args: [{ selector: 'lib-table-primary', standalone: false, template: "<div class=\"card\">\n <p-table [value]=\"tableData.data\" [tableStyle]=\"tableStyle\">\n <ng-template pTemplate=\"header\" *ngIf=\"showHeader\">\n <tr>\n <th *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\n {{ col.header }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData>\n <tr (click)=\"onRowClick(rowData)\" class=\"clickable-row\">\n <td *ngFor=\"let col of tableData.columns\" [style.width]=\"col.width\">\n <!-- Document Cell -->\n <div *ngIf=\"col.type === 'document'\" class=\"document-cell\">\n <div class=\"document-info\">\n <div class=\"document-icon\">\n <i class=\"pi pi-file-pdf\" *ngIf=\"getFileExtension(rowData.fileName) === 'PDF'\"></i>\n <i class=\"pi pi-image\" *ngIf=\"getFileExtension(rowData.fileName) === 'JPG' || getFileExtension(rowData.fileName) === 'PNG'\"></i>\n <i class=\"pi pi-file-excel\" *ngIf=\"getFileExtension(rowData.fileName) === 'XLSX'\"></i>\n <i class=\"pi pi-file\" *ngIf=\"getFileExtension(rowData.fileName) !== 'PDF' && getFileExtension(rowData.fileName) !== 'JPG' && getFileExtension(rowData.fileName) !== 'PNG' && getFileExtension(rowData.fileName) !== 'XLSX'\"></i>\n </div>\n <div class=\"document-details\">\n <div class=\"document-name\">{{ rowData.docName }}</div>\n <div class=\"file-info\">{{ rowData.fileName }} - {{ rowData.fileSize }}</div>\n </div>\n </div>\n </div>\n\n <!-- Status Cell -->\n \n <div *ngIf=\"col.type === 'status'\" class=\"status-cell\">\n <span class=\"status-pill\" [ngClass]=\"getStatusClass(rowData[col.field])\">\n <i [class]=\"getStatusIcon(rowData[col.field])\"></i>\n {{ rowData[col.field] }}\n </span>\n </div>\n\n <!-- Actions Cell -->\n <div *ngIf=\"col.type === 'actions'\" class=\"actions-cell\">\n <button pButton pRipple type=\"button\" icon=\"ri-delete-bin-6-line\" \n class=\"p-button-text p-button-rounded\" \n (click)=\"onActionClick($event, rowData)\">\n </button>\n </div>\n\n <!-- Default Text Cell -->\n <div *ngIf=\"!col.type || col.type === 'text'\" class=\"text-cell\">\n {{ rowData[col.field] }}\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>", styles: [".document-cell .document-info{display:flex;align-items:center;gap:.75rem;text-align:left}.document-cell .document-info .document-icon{width:40px;height:40px;background-color:#e3f2fd;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#1976d2;font-size:1.25rem;flex-shrink:0}.document-cell .document-info .document-details{flex:1;min-width:0}.document-cell .document-info .document-details .document-name{font-weight:400;color:#334155;line-height:20px;font-size:14px;margin-bottom:.25rem;text-align:left}.document-cell .document-info .document-details .file-info{font-size:.75rem;color:#6c757d;text-align:left}.status-cell .status-pill{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .75rem;border-radius:20px;font-size:.75rem;font-weight:500;white-space:nowrap;min-width:80px}.status-cell .status-pill i{font-size:.875rem}.status-cell .status-pill.status-pending{background-color:#f3f4f6;color:#6b7280}.status-cell .status-pill.status-approved{background-color:#d1fae5;color:#065f46}.status-cell .status-pill.status-alert{background-color:#fee2e2;color:#dc2626}.status-cell .status-pill.status-uploaded{background-color:#dbeafe;color:#1d4ed8}.status-cell .status-pill.status-reviewing{background-color:#fef3c7;color:#d97706}.status-cell .status-pill.status-rejected{background-color:#fee2e2;color:#dc2626}.actions-cell{text-align:left}.actions-cell .p-button{width:2rem;height:2rem;border-radius:50%;background-color:transparent;border:none;color:#6c757d}.actions-cell .p-button:hover{background-color:#f8f9fa;color:#495057}.text-cell{font-weight:500;color:#475569;font-size:14px;line-height:20px;text-align:left}.clickable-row{cursor:pointer;transition:background-color .2s ease}.clickable-row:hover{background-color:#f8f9fa!important}.clickable-row:active{background-color:#e9ecef!important}::ng-deep .p-datatable .p-datatable-wrapper{border:1px solid #E2E8F0;border-radius:10px}::ng-deep .p-datatable .p-datatable-thead>tr>th{background-color:#f8f9fa;border:none;border-bottom:1px solid #dee2e6;padding:1rem 1.5rem;font-weight:600;color:#64748b;font-size:.875rem;text-transform:capitalize;letter-spacing:.5px;text-align:left;border-radius:8px 8px 0 0}::ng-deep .p-datatable .p-datatable-thead>tr>th:first-child{border-top-left-radius:8px}::ng-deep .p-datatable .p-datatable-thead>tr>th:last-child{border-top-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr{border-bottom:1px solid #f1f3f4}::ng-deep .p-datatable .p-datatable-tbody>tr:hover{background-color:#f8f9fa}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:first-child{border-bottom-left-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr:last-child>td:last-child{border-bottom-right-radius:8px}::ng-deep .p-datatable .p-datatable-tbody>tr>td{border:none;padding:1rem 1.5rem;vertical-align:middle;text-align:left}\n"] }]
1916
2382
  }], propDecorators: { tableData: [{
1917
2383
  type: Input
1918
2384
  }], showHeader: [{
1919
2385
  type: Input
1920
2386
  }], tableStyle: [{
1921
2387
  type: Input
2388
+ }], rowClick: [{
2389
+ type: Output
1922
2390
  }] } });
1923
2391
 
1924
2392
  /**
@@ -1954,10 +2422,10 @@ class FileFormatService {
1954
2422
  return `${parseFloat(mbSize.toFixed(decimalPlaces))} ${sizes[SHARED.TWO]}`;
1955
2423
  }
1956
2424
  }
1957
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FileFormatService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1958
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FileFormatService, providedIn: 'root' });
2425
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FileFormatService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2426
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FileFormatService, providedIn: 'root' });
1959
2427
  }
1960
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FileFormatService, decorators: [{
2428
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FileFormatService, decorators: [{
1961
2429
  type: Injectable,
1962
2430
  args: [{
1963
2431
  providedIn: 'root'
@@ -2103,13 +2571,13 @@ class DocumentUploadComponent {
2103
2571
  triggerFileUpload() {
2104
2572
  this.fileUploader.choose();
2105
2573
  }
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 });
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 });
2574
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadComponent, deps: [{ token: DocumentUploadService }, { token: DocumentService }, { token: i3.PrimeNGConfig }, { token: FileFormatService }, { token: i3.MessageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2575
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentUploadComponent, isStandalone: false, selector: "lib-document-upload", inputs: { contextId: "contextId" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"26214400\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}.docHeader .p-button-icon{padding:.5rem}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "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 });
2108
2576
  }
2109
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentUploadComponent, decorators: [{
2577
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentUploadComponent, decorators: [{
2110
2578
  type: Component,
2111
2579
  args: [{ selector: 'lib-document-upload', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12 md:col-12\">\r\n <p-fileUpload #fileUploader [multiple]=\"true\" auto=\"true\" accept=\"image/png,application/pdf\" maxFileSize=\"26214400\"\r\n (onSelect)=\"onSelectedFiles($event)\">\r\n <ng-template pTemplate=\"header\" let-chooseCallback=\"chooseCallback\" let-clearCallback=\"clearCallback\">\r\n <div class=\"docHeader p-2 flex flex-wrap justify-content-between align-items-center flex-1 gap-2\">\r\n <div class=\"flex gap-2\">\r\n <p-button (onClick)=\"choose($event, chooseCallback)\" icon=\"pi pi-images\" [rounded]=\"true\"\r\n [outlined]=\"true\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\" let-removeFileCallback=\"removeFileCallback\"\r\n let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <div class=\"col-12 md:col-12 p-0\" *ngIf=\"uploadedFiles.length > 0\">\r\n <div *ngFor=\"let uploadedFile of uploadedFiles; let i = index\"\r\n class=\"m-0 flex flex-column align-items-center gap-1 mt-3\">\r\n <div class=\"col-12 md:col-12 p-0 flex documentInfo\">\r\n <div class=\"documentImage\">\r\n <img src=\"../../../../assets/images/document.png\" [alt]=\"uploadedFile.file.name\" width=\"45\" height=\"50\"\r\n class=\"object-contain\" />\r\n </div>\r\n <div class=\"flex w-full flex-column mt-2 ml-2\">\r\n <div class=\"flex justify-content-between\">\r\n <div style=\" font-weight: bold;font-size: 14px\">\r\n {{ uploadedFile.file.name }}\r\n </div>\r\n <i class=\"pi pi-times cursor-pointer\" (click)=\"handleDocumentRemove(uploadedFile.file,i)\"></i>\r\n </div>\r\n <div class=\"flex justify-content-between mt-1\">\r\n <div style=\"color: #676B89; font-size: 12px; color: green;\" class=\"pi pi-verified \"> {{ uploadedFile.formattedSize }}</div>\r\n <div class=\"white-space-nowrap\" style=\"color: #0F8BFD; font-family: 14px;\"> {{ uploadedFile.progress }} %</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-12 md:col-12 p-0\">\r\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\" styleClass=\"h-1/2rem md:ml-auto relative\"\r\n [ngClass]=\"{ 'exceeded-progress-bar': totalSizePercent > 100 }\">\r\n </p-progressBar>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"empty\" let-chooseCallback=\"chooseCallback\">\r\n <div *ngIf=\"!uploadedFiles.length\" class=\"flex align-items-center justify-content-center flex-column\"\r\n (click)=\"triggerFileUpload()\">\r\n <i class=\"pi pi-cloud-upload border-2 border-circle p-5 text-8xl text-400 border-400\"></i>\r\n <p class=\"mt-4 mb-0\">Drag and drop files here to upload.</p>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"file\"> </ng-template>\r\n </p-fileUpload>\r\n </div>\r\n</div>", styles: [".flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.flex-col{flex-direction:column}.text-muted-color{color:#6c757d}.p-fileupload-buttonbar{padding:0}.p-fileupload-content{background-color:#0f8bfd1a}.p-fileupload .p-fileupload-content{padding:1rem}.docHeader .p-button-icon{padding:.5rem}\n"] }]
2112
- }], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentService$1 }, { type: i3.PrimeNGConfig }, { type: FileFormatService }, { type: i3.MessageService }, { type: i0.ChangeDetectorRef }], propDecorators: { contextId: [{
2580
+ }], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentService }, { type: i3.PrimeNGConfig }, { type: FileFormatService }, { type: i3.MessageService }, { type: i0.ChangeDetectorRef }], propDecorators: { contextId: [{
2113
2581
  type: Input
2114
2582
  }], fileUploader: [{
2115
2583
  type: ViewChild,
@@ -2151,10 +2619,10 @@ class LinkedDocumentComponent {
2151
2619
  this.selectedDocument = document;
2152
2620
  this.selectedDocumentChange.emit(this.selectedDocument);
2153
2621
  }
2154
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinkedDocumentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2155
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: LinkedDocumentComponent, isStandalone: false, selector: "app-linked-document", inputs: { selectedDocument: "selectedDocument", documentList: "documentList" }, outputs: { selectedDocumentChange: "selectedDocumentChange" }, ngImport: i0, template: "<div class=\"summary-card mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\"\r\n style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px; background-color: #F9fafb;\">\r\n <div class=\"p-0\">\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Linked Documents</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\">\r\n @for(document of documentList; track document){\r\n <div class=\"linkedDocument documentName m-2\">\r\n <div class=\"documentName\" [class.selected]=\"document._id === selectedDocument?._id\"\r\n (click)=\"handleDocumentClick(document)\">\r\n <span class=\"pi pi-link\"></span>\r\n {{document.fileName}}\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n \r\n \r\n </div>\r\n ", styles: [".documentName{font-family:inherit;text-decoration:underline;cursor:pointer;width:max-content}.selected{color:var(--primary-color)}\n"] });
2622
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LinkedDocumentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2623
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: LinkedDocumentComponent, isStandalone: false, selector: "app-linked-document", inputs: { selectedDocument: "selectedDocument", documentList: "documentList" }, outputs: { selectedDocumentChange: "selectedDocumentChange" }, ngImport: i0, template: "<div class=\"summary-card mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\"\r\n style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px; background-color: #F9fafb;\">\r\n <div class=\"p-0\">\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Linked Documents</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\">\r\n @for(document of documentList; track document){\r\n <div class=\"linkedDocument documentName m-2\">\r\n <div class=\"documentName\" [class.selected]=\"document._id === selectedDocument?._id\"\r\n (click)=\"handleDocumentClick(document)\">\r\n <span class=\"pi pi-link\"></span>\r\n {{document.fileName}}\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n \r\n \r\n </div>\r\n ", styles: [".documentName{font-family:inherit;text-decoration:underline;cursor:pointer;width:max-content}.selected{color:var(--primary-color)}\n"] });
2156
2624
  }
2157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LinkedDocumentComponent, decorators: [{
2625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: LinkedDocumentComponent, decorators: [{
2158
2626
  type: Component,
2159
2627
  args: [{ selector: 'app-linked-document', standalone: false, template: "<div class=\"summary-card mb-4 pb-1\">\r\n <div class=\"card p-0 mb-0\"\r\n style=\"border-bottom: 1px solid;border-color: rgba(68, 72, 109, 0.2); border-bottom-right-radius: 0px;border-bottom-left-radius: 0px; background-color: #F9fafb;\">\r\n <div class=\"p-0\">\r\n <h4 class=\"m-0 pt-3 pl-3 mb-3\" style=\"font-size: 21px; font-weight: bold; \">Linked Documents</h4>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\" style=\"border-top-right-radius: 0px;border-top-left-radius: 0px;\">\r\n @for(document of documentList; track document){\r\n <div class=\"linkedDocument documentName m-2\">\r\n <div class=\"documentName\" [class.selected]=\"document._id === selectedDocument?._id\"\r\n (click)=\"handleDocumentClick(document)\">\r\n <span class=\"pi pi-link\"></span>\r\n {{document.fileName}}\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n \r\n \r\n </div>\r\n ", styles: [".documentName{font-family:inherit;text-decoration:underline;cursor:pointer;width:max-content}.selected{color:var(--primary-color)}\n"] }]
2160
2628
  }], propDecorators: { selectedDocument: [{
@@ -2243,13 +2711,13 @@ class DocumentViewerComponent {
2243
2711
  ngOnDestroy() {
2244
2712
  this.subscription.unsubscribe();
2245
2713
  }
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 });
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 });
2714
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
2715
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", 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 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 <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 <div class=\"incorrect-docType\">\r\n ContentType is incorrect.\r\n </div>\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: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.PdfViewerComponent, selector: "pdf-viewer", inputs: ["src", "c-maps-url", "page", "render-text", "render-text-mode", "original-size", "show-all", "stick-to-page", "zoom", "zoom-scale", "rotation", "external-link-target", "autoresize", "fit-to-page", "show-borders"], outputs: ["after-load-complete", "page-rendered", "pages-initialized", "text-layer-rendered", "error", "on-progress", "pageChange"] }, { kind: "component", type: LinkedDocumentComponent, selector: "app-linked-document", inputs: ["selectedDocument", "documentList"], outputs: ["selectedDocumentChange"] }], encapsulation: i0.ViewEncapsulation.None });
2248
2716
  }
2249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentViewerComponent, decorators: [{
2717
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, decorators: [{
2250
2718
  type: Component,
2251
- args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n *ngIf=\"isImage(selectedDocument?.contentType)\"\r\n class=\"img-container\"\r\n >\r\n <img\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n class=\"uploadedImages\"\r\n alt=\"Document Image\"\r\n />\r\n </div>\r\n @if(selectedDocument?.contentType && selectedDocument?.contentType === \"application/pdf\"){\r\n <div class=\"pdf-container\">\r\n <pdf-viewer\r\n [src]=\"selectedDocument?.documentUrl || ''\"\r\n [rotation]=\"0\"\r\n [original-size]=\"false\"\r\n [show-all]=\"true\"\r\n [fit-to-page]=\"false\"\r\n [zoom]=\"1\"\r\n [zoom-scale]=\"'page-width'\"\r\n [stick-to-page]=\"false\"\r\n [render-text]=\"true\"\r\n [external-link-target]=\"'blank'\"\r\n [autoresize]=\"true\"\r\n [show-borders]=\"false\"\r\n style=\"width: 50vw; height: 75vh\"\r\n ></pdf-viewer>\r\n </div>\r\n }@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"] }]
2252
- }], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentService }], propDecorators: { selectedDocument: [{
2719
+ args: [{ selector: 'document-viewer', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"grid\">\r\n <div class=\"col-12\">\r\n <div class=\"p-fluid p-formgrid grid m-0\">\r\n <div class=\"col-12 md:col-12 md:flex justify-content-evenly\">\r\n @if(selectedDocument){\r\n <div id=\"outerContainer col-12 md:col-7\">\r\n <div\r\n 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 <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 <div class=\"incorrect-docType\">\r\n ContentType is incorrect.\r\n </div>\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"] }]
2720
+ }], ctorParameters: () => [{ type: DocumentHttpService }, { type: DocumentHelperService }], propDecorators: { selectedDocument: [{
2253
2721
  type: Input
2254
2722
  }], documentList: [{
2255
2723
  type: Input
@@ -2266,7 +2734,6 @@ class DocumentListComponent {
2266
2734
  documentQuery;
2267
2735
  documentStore;
2268
2736
  documentTableBuilder;
2269
- onRefresh = new EventEmitter();
2270
2737
  /**
2271
2738
  * Represents the context ID for the document list.
2272
2739
  * This value is passed from the parent component.
@@ -2274,6 +2741,16 @@ class DocumentListComponent {
2274
2741
  * @memberof DocumentListComponent
2275
2742
  */
2276
2743
  contextId = SHARED.EMPTY;
2744
+ /**
2745
+ * The document list response data passed from the parent component.
2746
+ * @type {DocumentListResponse[] | null}
2747
+ * @memberof DocumentListComponent
2748
+ */
2749
+ documentListResponse = null;
2750
+ /**
2751
+ * Subscription to document list response from store
2752
+ */
2753
+ documentListSubscription = new Subscription();
2277
2754
  /**
2278
2755
  * Default visibility of the upload button.
2279
2756
  * @type {boolean}
@@ -2292,12 +2769,6 @@ class DocumentListComponent {
2292
2769
  * @memberof DocumentListComponent
2293
2770
  */
2294
2771
  isSidebarVisible = SHARED.FALSE;
2295
- /**
2296
- * Default visibility of the Accordion.
2297
- * @type {boolean}
2298
- * @memberof DocumentListComponent
2299
- */
2300
- isCollapsed = SHARED.FALSE;
2301
2772
  /**
2302
2773
  * Default visibility of the messages.
2303
2774
  * @type {Message[]}
@@ -2346,13 +2817,19 @@ class DocumentListComponent {
2346
2817
  */
2347
2818
  fileName;
2348
2819
  /**
2349
- * Document sections data for rendering tables
2820
+ * Table data for each category
2350
2821
  */
2351
- documentSections = DUMMY_DOCUMENT_SECTIONS;
2822
+ categoryTables = [];
2352
2823
  /**
2353
- * Table data for each section
2824
+ * Document categories from the response
2354
2825
  */
2355
- sectionTables = [];
2826
+ documentCategories = [];
2827
+ /**
2828
+ * Filter properties
2829
+ */
2830
+ status = null;
2831
+ category = null;
2832
+ searchKey = null;
2356
2833
  /**
2357
2834
  * Creates an instance of DocumentListComponent.
2358
2835
  * @class
@@ -2373,7 +2850,7 @@ class DocumentListComponent {
2373
2850
  */
2374
2851
  ngOnInit() {
2375
2852
  this.getDocumentTypeList();
2376
- this.buildSectionTables();
2853
+ this.setupDocumentListSubscription();
2377
2854
  }
2378
2855
  /**
2379
2856
  * Handles the click event for file upload.
@@ -2386,17 +2863,6 @@ class DocumentListComponent {
2386
2863
  this.documentStore.setMessage(SHARED.EMPTY_ARRAY);
2387
2864
  this.isSidebarVisible = SHARED.TRUE;
2388
2865
  }
2389
- /**
2390
- * Handles the selection of an individual document.
2391
- * Opens a dialog to display or manage the selected document.
2392
- * @param {DocumentModel} document - The document that was clicked by the user.
2393
- * @memberof DocumentListComponent
2394
- */
2395
- handleClickForDocument(document) {
2396
- this.isdialogVisible = SHARED.TRUE;
2397
- this.selectedDocument = document;
2398
- this.fileName = document.fileName;
2399
- }
2400
2866
  /**
2401
2867
  * Handles the save click event to update the document's file name.
2402
2868
  * This method creates a payload with the updated file name and calls the
@@ -2411,15 +2877,6 @@ class DocumentListComponent {
2411
2877
  console.log(`${SHARED.UPDATE_DOCUMENT_NAME} ${this.selectedDocument._id}`);
2412
2878
  });
2413
2879
  }
2414
- /**
2415
- * Closes the dialog and resets the selected document.
2416
- * @memberof DocumentListComponent
2417
- */
2418
- handleCloseModal() {
2419
- this.selectedDocument = { _id: SHARED.EMPTY };
2420
- this.isdialogVisible = SHARED.FALSE;
2421
- this.onRefresh.emit();
2422
- }
2423
2880
  /**
2424
2881
  * Handles the upload action for a document.
2425
2882
  * Validates if a document type is selected and logs the result.
@@ -2432,7 +2889,6 @@ class DocumentListComponent {
2432
2889
  this.documentQuery.selectMessages().subscribe((message) => {
2433
2890
  if (message.length > 0) {
2434
2891
  this.messages = message;
2435
- this.onRefresh.emit();
2436
2892
  this.selectedOption = null;
2437
2893
  setTimeout(() => {
2438
2894
  this.messages = SHARED.EMPTY_ARRAY;
@@ -2481,115 +2937,339 @@ class DocumentListComponent {
2481
2937
  this.isSidebarVisible = isVisible;
2482
2938
  }
2483
2939
  /**
2484
- * Builds table data for all document sections
2940
+ * Builds table data for all document categories
2485
2941
  */
2486
- buildSectionTables() {
2487
- this.sectionTables = this.documentTableBuilder.buildDocumentSectionsTables(this.documentSections);
2942
+ buildCategoryTables() {
2943
+ this.categoryTables = this.documentTableBuilder.buildDocumentCategoriesTables(this.documentCategories);
2488
2944
  }
2489
2945
  /**
2490
- * Gets completion count for a section
2946
+ * Gets completion count for a category
2491
2947
  */
2492
- getCompletionCount(section) {
2493
- return this.documentTableBuilder.getCompletionCount(section);
2948
+ getCompletionCount(category) {
2949
+ return this.documentTableBuilder.getCompletionCount(category);
2950
+ }
2951
+ /**
2952
+ * Gets pending document count for a category
2953
+ */
2954
+ getPendingDocumentCount(category) {
2955
+ return this.documentTableBuilder.getPendingDocumentCount(category);
2956
+ }
2957
+ /**
2958
+ * Gets approved document count for a category
2959
+ */
2960
+ getApprovedDocumentCount(category) {
2961
+ return this.documentTableBuilder.getApprovedDocumentCount(category);
2962
+ }
2963
+ /**
2964
+ * Builds document categories from the API response
2965
+ */
2966
+ buildDocumentCategories() {
2967
+ console.log('Building document categories with response:', this.documentListResponse);
2968
+ if (!this.documentListResponse) {
2969
+ this.documentCategories = [];
2970
+ this.categoryTables = [];
2971
+ console.log('No document response, clearing tables');
2972
+ return;
2973
+ }
2974
+ this.documentCategories = [...this.documentListResponse];
2975
+ this.categoryTables = this.documentListResponse.map(category => this.documentTableBuilder.buildDocumentTable(category.list));
2976
+ console.log('Built category tables:', this.categoryTables.length);
2977
+ }
2978
+ /**
2979
+ * Sets up subscription to document list response from store
2980
+ */
2981
+ setupDocumentListSubscription() {
2982
+ this.documentListSubscription.add(this.documentQuery.selectDocumentListResponse().subscribe({
2983
+ next: (response) => {
2984
+ console.log('DocumentListComponent received response:', response);
2985
+ this.documentListResponse = response;
2986
+ this.buildDocumentCategories();
2987
+ },
2988
+ error: (error) => {
2989
+ console.error('Error receiving document list response:', error);
2990
+ }
2991
+ }));
2494
2992
  }
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 });
2993
+ handleTableRowClick(rowData) {
2994
+ this.isdialogVisible = SHARED.TRUE;
2995
+ this.selectedDocument = rowData;
2996
+ }
2997
+ /**
2998
+ * Cleanup subscriptions on component destroy
2999
+ */
3000
+ ngOnDestroy() {
3001
+ this.documentListSubscription.unsubscribe();
3002
+ }
3003
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, deps: [{ token: DocumentUploadService }, { token: DocumentHttpService }, { token: DocumentQuery }, { token: DocumentStore }, { token: DocumentTableBuilderService }], target: i0.ɵɵFactoryTarget.Component });
3004
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListComponent, isStandalone: false, selector: "lib-document-list", inputs: { contextId: "contextId", documentListResponse: "documentListResponse", isUploadButtonVisible: "isUploadButtonVisible", documentList: "documentList", status: "status", category: "category", searchKey: "searchKey" }, ngImport: i0, template: "<div class=\"document-viewer\">\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\">\n <ng-template pTemplate=\"header\">\n <div class=\"w-full flex align-items-center justify-content-between\">\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\n [(ngModel)]=\"fileName\" />\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\n </button>\n </div>\n </ng-template>\n <ng-content></ng-content>\n </document-viewer>\n </p-dialog>\n</div>\n\n\n<div class=\"document-categories-container\">\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\n <div class=\"category-header\">\n <div class=\"category-title\">\n <h3>{{ category.label }} Documents</h3>\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\n </div>\n <div class=\"completion-status\">\n <span class=\"status-badge\">{{ getCompletionCount(category) }} Complete</span>\n </div>\n </div>\n\n <div class=\"table-container\">\n <lib-table-primary \n [tableData]=\"categoryTables[i]\" \n [tableStyle]=\"{ 'min-width': '100%' }\"\n (rowClick)=\"handleTableRowClick($event)\">\n </lib-table-primary>\n </div>\n </div>\n</div>\n<div class=\"grid m-0\">\n <div class=\"col-12 p-0\">\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\n <ng-template pTemplate=\"header\">\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\n </ng-template>\n <ng-template pTemplate=\"content\">\n <div class=\"side-bar-con\">\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\n <div class=\"p-fluid\">\n <div class=\"field\">\n <label for=\"city\">Select Folder</label>\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\n <div class=\"bg-gray-100 p-4\">\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\n [disabled]=\"!selectedOption\">\n </p-button>\n </div>\n </ng-template>\n </p-sidebar>\n </div>\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i8.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i8.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i9.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "component", type: i10.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "directive", type: i11.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i11.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i11.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i12.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: i13.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "autoShowPanelOnPrintableCharacterKeyDown", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i14.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: TablePrimaryComponent, selector: "lib-table-primary", inputs: ["tableData", "showHeader", "tableStyle"], outputs: ["rowClick"] }, { kind: "component", type: DocumentUploadComponent, selector: "lib-document-upload", inputs: ["contextId"] }, { kind: "component", type: DocumentViewerComponent, selector: "document-viewer", inputs: ["selectedDocument", "documentList"] }], encapsulation: i0.ViewEncapsulation.None });
2497
3005
  }
2498
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListComponent, decorators: [{
3006
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListComponent, decorators: [{
2499
3007
  type: Component,
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: [{
2502
- type: Output
2503
- }], contextId: [{
3008
+ args: [{ selector: 'lib-document-list', standalone: false, encapsulation: ViewEncapsulation.None, template: "<div class=\"document-viewer\">\n <p-dialog [(visible)]=\"isdialogVisible\" [modal]=\"true\" \n class=\"w-full h-full document-dailog-wrapper\" [draggable]=\"false\" [closable]=\"true\">\n <document-viewer [selectedDocument]=\"selectedDocument\" [documentList]=\"documentList\">\n <ng-template pTemplate=\"header\">\n <div class=\"w-full flex align-items-center justify-content-between\">\n <input type=\"text\" class=\"w-full border-none bg-white h-3rem file-input-wrapper\" pInputText\n [(ngModel)]=\"fileName\" />\n <button pButton pRipple class=\"mx-3 w-6rem save-btn-wrapper\" label=\"Save\" (click)=\"handleSaveClick()\">\n </button>\n </div>\n </ng-template>\n <ng-content></ng-content>\n </document-viewer>\n </p-dialog>\n</div>\n\n\n<div class=\"document-categories-container\">\n <div class=\"category\" *ngFor=\"let category of documentCategories; let i = index\">\n <div class=\"category-header\">\n <div class=\"category-title\">\n <h3>{{ category.label }} Documents</h3>\n <p class=\"category-description\">{{ category.categoryDescription }}</p>\n </div>\n <div class=\"completion-status\">\n <span class=\"status-badge\">{{ getCompletionCount(category) }} Complete</span>\n </div>\n </div>\n\n <div class=\"table-container\">\n <lib-table-primary \n [tableData]=\"categoryTables[i]\" \n [tableStyle]=\"{ 'min-width': '100%' }\"\n (rowClick)=\"handleTableRowClick($event)\">\n </lib-table-primary>\n </div>\n </div>\n</div>\n<div class=\"grid m-0\">\n <div class=\"col-12 p-0\">\n <p-sidebar [(visible)]=\"isSidebarVisible\" position=\"right\" [styleClass]=\"'right-sidebar'\" class=\"relative\">\n <ng-template pTemplate=\"header\">\n <p-messages [(value)]=\"messages\" [enableService]=\"false\" />\n </ng-template>\n <ng-template pTemplate=\"content\">\n <div class=\"side-bar-con\">\n <lib-document-upload [contextId]=\"contextId\"></lib-document-upload>\n <div class=\"p-fluid\">\n <div class=\"field\">\n <label for=\"city\">Select Folder</label>\n <p-dropdown id=\"city\" optionLabel=\"label\" optionValue=\"value\" [options]=\"options\"\n placeholder=\"Select a Folder\" [(ngModel)]=\"selectedOption\"></p-dropdown>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template pTemplate=\"footer\" class=\"bg-gray-100 p-0\">\n <div class=\"bg-gray-100 p-4\">\n <p-button label=\"Save\" class=\"p-button-rounded p-button-success save-btn\" (click)=\"handleUploadDocument()\"\n [disabled]=\"!selectedOption\">\n </p-button>\n </div>\n </ng-template>\n </p-sidebar>\n </div>\n</div>", styles: [".document-list-wrapper .p-accordion-header-link{padding:.5rem}.document-list-wrapper .p-sidebar-right,.right-sidebar{width:35%}.document-title-wrapper{font-size:20px;font-weight:700;color:var(--text-color)}.document-input-field{display:flex;flex-direction:column}.document-input-field input{width:100%;height:46px;padding:10px 15px;gap:10px;border-radius:10px;outline:none;border:1px solid rgba(76,98,146,.1019607843);font-size:15px}label{color:#0f1729;font-weight:600}.document-list-dropDown .p-element{padding:10px 0 10px 15px}.document-list-dropDown .p-dropdown{border-radius:10px!important}.side-bar-con{display:flex;flex-direction:column}.save-btn-con{width:100%;border-top:1px solid rgba(76,98,146,.2);background:#4c629214;padding:13px 40px}.save-btn-wrapper{padding:10px 4px}.save-btn .p-button{height:45px!important;width:140px;border-radius:10px}.p-sidebar-footer{padding:0}.file-input-wrapper.p-inputtext:enabled:focus{box-shadow:0 0 0 .2rem #a6d5fa!important}.document-categories-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-categories-container .category{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-categories-container .category .category-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-categories-container .category .category-header .category-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-categories-container .category .category-header .category-title .category-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-categories-container .category .category-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-categories-container .category .table-container{padding:0}.document-sections-container{padding:1rem;background-color:#f8f9fa;min-height:100vh}.document-sections-container .section{background:#fff;border-radius:8px;margin-bottom:2rem;box-shadow:0 2px 4px #0000001a;overflow:hidden}.document-sections-container .section .section-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.5rem 1.5rem 1rem;border-bottom:1px solid #e9ecef}.document-sections-container .section .section-header .section-title h3{margin:0 0 .5rem;font-size:1.25rem;font-weight:600;color:#2c3e50}.document-sections-container .section .section-header .section-title .section-description{margin:0;color:#6c757d;font-size:.875rem;line-height:1.4}.document-sections-container .section .section-header .completion-status .status-badge{background-color:#fbbf24;color:#92400e;padding:.375rem .75rem;border-radius:6px;font-size:.75rem;font-weight:500;display:inline-block}.document-sections-container .section .table-container{padding:0}@media (max-width: 768px){.document-categories-container,.document-sections-container{padding:.5rem}.document-categories-container .category .category-header,.document-categories-container .category .section-header,.document-categories-container .section .category-header,.document-categories-container .section .section-header,.document-sections-container .category .category-header,.document-sections-container .category .section-header,.document-sections-container .section .category-header,.document-sections-container .section .section-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-categories-container .category .category-header .completion-status,.document-categories-container .category .section-header .completion-status,.document-categories-container .section .category-header .completion-status,.document-categories-container .section .section-header .completion-status,.document-sections-container .category .category-header .completion-status,.document-sections-container .category .section-header .completion-status,.document-sections-container .section .category-header .completion-status,.document-sections-container .section .section-header .completion-status{align-self:flex-end}}\n"] }]
3009
+ }], ctorParameters: () => [{ type: DocumentUploadService }, { type: DocumentHttpService }, { type: DocumentQuery }, { type: DocumentStore }, { type: DocumentTableBuilderService }], propDecorators: { contextId: [{
2504
3010
  type: Input
2505
- }], isUploadButtonVisible: [{
3011
+ }], documentListResponse: [{
2506
3012
  type: Input
2507
- }], isCollapsed: [{
3013
+ }], isUploadButtonVisible: [{
2508
3014
  type: Input
2509
3015
  }], documentList: [{
2510
3016
  type: Input
3017
+ }], status: [{
3018
+ type: Input
3019
+ }], category: [{
3020
+ type: Input
3021
+ }], searchKey: [{
3022
+ type: Input
2511
3023
  }] } });
2512
3024
 
3025
+ class DocumentMenuService {
3026
+ documentStore;
3027
+ constructor(documentStore) {
3028
+ this.documentStore = documentStore;
3029
+ }
3030
+ /**
3031
+ * Gets the category name for a given menu item _id
3032
+ * @param menuItemId - The _id of the menu item
3033
+ * @param categories - The list of document categories
3034
+ * @returns The category name or null if not found
3035
+ */
3036
+ getMenuItemCategory(menuItemId, categories) {
3037
+ for (const category of categories) {
3038
+ if (category.items?.some((menuItem) => menuItem._id === menuItemId)) {
3039
+ return category.label;
3040
+ }
3041
+ }
3042
+ return null;
3043
+ }
3044
+ /**
3045
+ * Gets the menu item by its _id
3046
+ * @param menuItemId - The _id of the menu item
3047
+ * @param categories - The list of document categories
3048
+ * @returns The menu item or null if not found
3049
+ */
3050
+ getMenuItemById(menuItemId, categories) {
3051
+ for (const category of categories) {
3052
+ if (category.items) {
3053
+ const item = category.items.find((menuItem) => menuItem._id === menuItemId);
3054
+ if (item) {
3055
+ return item;
3056
+ }
3057
+ }
3058
+ }
3059
+ return null;
3060
+ }
3061
+ /**
3062
+ * Handles user list visibility based on menu item category
3063
+ * @param menuItemId - The _id of the menu item
3064
+ * @param categories - The list of document categories
3065
+ */
3066
+ handleUserListVisibility(menuItemId, categories) {
3067
+ const category = this.getMenuItemCategory(menuItemId, categories);
3068
+ const menuItem = this.getMenuItemById(menuItemId, categories);
3069
+ if (category === SHARED.APPLICATION) {
3070
+ this.documentStore.setShowUserList(true);
3071
+ }
3072
+ else if (category === SHARED.APPLICANTS) {
3073
+ this.documentStore.setShowUserList(true);
3074
+ }
3075
+ else {
3076
+ this.documentStore.setShowUserList(false);
3077
+ this.documentStore.setSelectedUserId(null);
3078
+ this.documentStore.setSelectedStatus(null);
3079
+ }
3080
+ }
3081
+ /**
3082
+ * Handles document status based on selected menu item
3083
+ * @param menuItemId - The _id of the selected menu item
3084
+ * @param categories - The list of document categories
3085
+ */
3086
+ handleDocumentStatus(menuItemId, categories) {
3087
+ const menuItem = this.getMenuItemById(menuItemId, categories);
3088
+ if (menuItem) {
3089
+ // You can add logic here to handle document status based on the selected menu item
3090
+ // For example, filtering documents by status, updating status counts, etc.
3091
+ console.log('Selected menu item:', menuItem.label, 'with status:', menuItem.status);
3092
+ }
3093
+ }
3094
+ /**
3095
+ * Calculates total documents for a menu item
3096
+ * @param item - The menu item
3097
+ * @returns Total number of documents
3098
+ */
3099
+ getTotalDocuments(item) {
3100
+ return item.status.Pending + item.status.Reviewing + item.status.Accepted + item.status.Rejected;
3101
+ }
3102
+ /**
3103
+ * Calculates completed documents for a menu item
3104
+ * @param item - The menu item
3105
+ * @returns Number of completed documents
3106
+ */
3107
+ getCompletedDocuments(item) {
3108
+ return item.status.Accepted;
3109
+ }
3110
+ /**
3111
+ * Gets badge value for a menu item
3112
+ * @param item - The menu item
3113
+ * @returns Badge value string (e.g., "1/2")
3114
+ */
3115
+ getBadgeValue(item) {
3116
+ const completed = this.getCompletedDocuments(item);
3117
+ const total = this.getTotalDocuments(item);
3118
+ return `${completed}/${total}`;
3119
+ }
3120
+ /**
3121
+ * Gets badge severity based on status
3122
+ * @param item - The menu item
3123
+ * @returns Badge severity for PrimeNG
3124
+ */
3125
+ getBadgeSeverity(item) {
3126
+ const completed = this.getCompletedDocuments(item);
3127
+ const total = this.getTotalDocuments(item);
3128
+ if (total === 0)
3129
+ return 'info';
3130
+ if (completed === total)
3131
+ return 'success';
3132
+ if (completed > 0)
3133
+ return 'warning';
3134
+ return 'danger';
3135
+ }
3136
+ /**
3137
+ * Checks if badge should be shown for a menu item
3138
+ * @param item - The menu item
3139
+ * @returns True if badge should be shown
3140
+ */
3141
+ shouldShowBadge(item) {
3142
+ return this.getTotalDocuments(item) > 0;
3143
+ }
3144
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Injectable });
3145
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, providedIn: 'root' });
3146
+ }
3147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentMenuService, decorators: [{
3148
+ type: Injectable,
3149
+ args: [{
3150
+ providedIn: 'root'
3151
+ }]
3152
+ }], ctorParameters: () => [{ type: DocumentStore }] });
3153
+
2513
3154
  class DocumentsMenuComponent {
2514
3155
  documentStore;
2515
3156
  documentQuery;
2516
- // Get the menu list from container
2517
- items;
3157
+ documentMenuService;
3158
+ documentHelperService;
3159
+ catagories = SHARED.EMPTY_ARRAY;
3160
+ applicationNumber = SHARED.EMPTY;
3161
+ contextId = SHARED.EMPTY;
2518
3162
  selectedMenuItem = null;
2519
- constructor(documentStore, documentQuery) {
3163
+ selectedMenuItemId = null;
3164
+ constructor(documentStore, documentQuery, documentMenuService, documentHelperService) {
2520
3165
  this.documentStore = documentStore;
2521
3166
  this.documentQuery = documentQuery;
3167
+ this.documentMenuService = documentMenuService;
3168
+ this.documentHelperService = documentHelperService;
2522
3169
  }
2523
3170
  ngOnInit() {
2524
- // Subscribe to selected menu item from state
2525
- this.documentQuery.selectSelectedMenuItem().subscribe(menuItem => {
2526
- this.selectedMenuItem = menuItem;
3171
+ this.documentQuery.selectSelectedMenuItem().subscribe(menuItemId => {
3172
+ this.selectedMenuItemId = menuItemId;
3173
+ this.selectedMenuItem = this.findMenuItemLabelById(menuItemId);
2527
3174
  });
2528
3175
  }
3176
+ ngOnChanges(changes) {
3177
+ if (changes['catagories'] && this.catagories) {
3178
+ this.updateMenuItemsData();
3179
+ }
3180
+ }
3181
+ /**
3182
+ * Finds the label of a menu item by its _id
3183
+ * @param id The _id to search for
3184
+ * @returns The label of the menu item or null if not found
3185
+ */
3186
+ findMenuItemLabelById(id) {
3187
+ if (!id)
3188
+ return null;
3189
+ for (const category of this.catagories) {
3190
+ if (category.items) {
3191
+ const item = category.items.find(item => item._id === id);
3192
+ if (item) {
3193
+ return item.label;
3194
+ }
3195
+ }
3196
+ }
3197
+ return null;
3198
+ }
3199
+ /**
3200
+ * Update menu use catagories
3201
+ */
3202
+ updateMenuItemsData() {
3203
+ this.catagories.forEach(category => {
3204
+ if (category.items) {
3205
+ category.items.forEach(item => {
3206
+ item.menuData = {
3207
+ totalDocuments: this.documentMenuService.getTotalDocuments(item),
3208
+ completedDocuments: this.documentMenuService.getCompletedDocuments(item),
3209
+ badgeValue: this.documentMenuService.getBadgeValue(item),
3210
+ badgeSeverity: this.documentMenuService.getBadgeSeverity(item),
3211
+ shouldShowBadge: this.documentMenuService.shouldShowBadge(item)
3212
+ };
3213
+ });
3214
+ }
3215
+ });
3216
+ }
3217
+ /**
3218
+ * Handle the menu item click
3219
+ * @param {*} event - Event
3220
+ * @param {DocumentCategoryItem} item - catagory item
3221
+ */
2529
3222
  onMenuItemClick(event, item) {
2530
- if (this.selectedMenuItem === item.label) {
3223
+ if (this.selectedMenuItemId === item._id) {
3224
+ console.log('Deselecting menu item:', item._id);
3225
+ console.log('Using contextId for API call:', this.contextId);
2531
3226
  this.selectedMenuItem = null;
3227
+ this.selectedMenuItemId = null;
2532
3228
  this.documentStore.setSelectedMenuItem(null);
3229
+ // Force refresh to get unfiltered results
3230
+ this.documentHelperService.refreshDocumentsWithoutFilters(this.contextId);
2533
3231
  }
2534
3232
  else {
3233
+ console.log('Selecting menu item:', item._id);
2535
3234
  this.selectedMenuItem = item.label;
2536
- this.documentStore.setSelectedMenuItem(item.label);
2537
- this.handleUserListVisibility(item.label);
3235
+ this.selectedMenuItemId = item._id;
3236
+ this.documentStore.setSelectedMenuItem(item._id);
3237
+ this.documentMenuService.handleUserListVisibility(item._id, this.catagories);
2538
3238
  }
2539
3239
  }
2540
- selectMenuItem(menuItemLabel) {
2541
- this.selectedMenuItem = menuItemLabel;
2542
- this.documentStore.setSelectedMenuItem(menuItemLabel);
2543
- this.handleUserListVisibility(menuItemLabel);
3240
+ onSelectMenuItem(menuItemId) {
3241
+ const label = this.findMenuItemLabelById(menuItemId);
3242
+ if (label) {
3243
+ this.selectedMenuItem = label;
3244
+ this.selectedMenuItemId = menuItemId;
3245
+ this.documentStore.setSelectedMenuItem(menuItemId);
3246
+ this.documentMenuService.handleUserListVisibility(menuItemId, this.catagories);
3247
+ }
2544
3248
  }
2545
- // Method to programmatically unselect menu item
2546
- unselectMenuItem() {
3249
+ onUnselectMenuItem() {
2547
3250
  this.selectedMenuItem = null;
3251
+ this.selectedMenuItemId = null;
2548
3252
  this.documentStore.setSelectedMenuItem(null);
3253
+ // Force refresh to get unfiltered results
3254
+ this.documentHelperService.refreshDocumentsWithoutFilters(this.contextId);
2549
3255
  }
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
3256
  getSelectedMenuItem() {
2556
3257
  return this.selectedMenuItem;
2557
3258
  }
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;
3259
+ getSelectedMenuItemId() {
3260
+ return this.selectedMenuItemId;
2569
3261
  }
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"] }] });
3262
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, deps: [{ token: DocumentStore }, { token: DocumentQuery }, { token: DocumentMenuService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
3263
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentsMenuComponent, isStandalone: false, selector: "lib-documents-menu", inputs: { catagories: "catagories", applicationNumber: "applicationNumber", contextId: "contextId" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-sidebar-container h-full\">\r\n <p-card class=\"widget-menu-wrapper h-full\">\r\n <div class=\"flex align-items-center justify-content-between widget-menu-header-wrapper\">\r\n <p class=\"mb-0 application-title-wrapper\">ID - {{applicationNumber}}</p>\r\n <div class=\"expand-icon-wrapper\">\r\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\r\n </div>\r\n </div>\r\n\r\n <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"catagories\" styleClass=\"w-full md:w-15rem\">\r\n <ng-template pTemplate=\"submenuheader\" let-item>\r\n <span [style]=\"{\r\n color : '#9EA0B3'\r\n }\">{{ item.label }}</span>\r\n </ng-template>\r\n <ng-template pTemplate=\"item\" let-item>\r\n <a pRipple \r\n class=\"flex align-items-center p-menuitem-link\"\r\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\r\n (click)=\"onMenuItemClick($event, item)\">\r\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\r\n <span class=\"ml-2\">{{ item.label }}</span>\r\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \r\n class=\"ml-auto\" \r\n [severity]=\"item.menuData?.badgeSeverity\" \r\n [value]=\"item.menuData?.badgeValue\" />\r\n </a>\r\n </ng-template>\r\n </p-menu>\r\n </div>\r\n </div>\r\n </p-card>\r\n</div>\r\n\r\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-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: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7$1.Badge, selector: "p-badge", inputs: ["styleClass", "style", "badgeSize", "severity", "value", "badgeDisabled", "size"] }, { kind: "component", type: i8$2.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaLabel", "ariaLabelledBy", "id", "tabindex"], outputs: ["onShow", "onHide", "onBlur", "onFocus"] }, { kind: "component", type: i9$1.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }] });
2588
3264
  }
2589
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentsMenuComponent, decorators: [{
3265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentsMenuComponent, decorators: [{
2590
3266
  type: Component,
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: [{
3267
+ 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 - {{applicationNumber}}</p>\r\n <div class=\"expand-icon-wrapper\">\r\n <i class=\"ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full\"></i>\r\n </div>\r\n </div>\r\n\r\n <div class=\"widget-menu-container\" >\r\n <div class=\"widget-menu-wrapper h-ful l custom-scroll\">\r\n <p-menu [model]=\"catagories\" styleClass=\"w-full md:w-15rem\">\r\n <ng-template pTemplate=\"submenuheader\" let-item>\r\n <span [style]=\"{\r\n color : '#9EA0B3'\r\n }\">{{ item.label }}</span>\r\n </ng-template>\r\n <ng-template pTemplate=\"item\" let-item>\r\n <a pRipple \r\n class=\"flex align-items-center p-menuitem-link\"\r\n [class.selected-menu-item]=\"selectedMenuItemId === item._id\"\r\n (click)=\"onMenuItemClick($event, item)\">\r\n <span [class]=\"item.icon\" class=\"text-xl\"></span>\r\n <span class=\"ml-2\">{{ item.label }}</span>\r\n <p-badge *ngIf=\"item.menuData?.shouldShowBadge\" \r\n class=\"ml-auto\" \r\n [severity]=\"item.menuData?.badgeSeverity\" \r\n [value]=\"item.menuData?.badgeValue\" />\r\n </a>\r\n </ng-template>\r\n </p-menu>\r\n </div>\r\n </div>\r\n </p-card>\r\n</div>\r\n\r\n ", styles: [".expand-icon-wrapper{border:1px solid var(--primary-color);height:24px;width:24px;border-radius:50%;background:var(--blue-bg-light)}::ng-deep .p-badge.p-badge-success{background-color:#dcfce7;color:#16a34a;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-danger{background-color:#fee2e2;color:#dc2626;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-badge.p-badge-warning{background-color:#fef3c7;color:#d97706;font-family:inherit;font-size:12px;font-weight:400;font-style:inherit}::ng-deep .p-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"] }]
3268
+ }], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentQuery }, { type: DocumentMenuService }, { type: DocumentHelperService }], propDecorators: { catagories: [{
3269
+ type: Input
3270
+ }], applicationNumber: [{
3271
+ type: Input
3272
+ }], contextId: [{
2593
3273
  type: Input
2594
3274
  }] } });
2595
3275
 
@@ -2603,6 +3283,7 @@ class DocumentContainerComponent {
2603
3283
  documentService;
2604
3284
  documentQuery;
2605
3285
  documentHttpService;
3286
+ documentHelperService;
2606
3287
  /**
2607
3288
  * Creates an instance of DocumentContainerComponent.
2608
3289
  * @param {DocumentStore} documentStore - Query Store service to manage store document-related state.
@@ -2610,11 +3291,14 @@ class DocumentContainerComponent {
2610
3291
  * @param {DocumentQuery} documentQuery - Query service to manage document-related state.
2611
3292
  * @param {DocumentHttpService} documentHttpService - Service to make HTTP requests related to documents.
2612
3293
  */
2613
- constructor(documentStore, documentService, documentQuery, documentHttpService) {
3294
+ constructor(documentStore, documentService, documentQuery, documentHttpService, documentHelperService) {
3295
+ // Note: initializeSelectionWatcher now requires contextId
3296
+ // This should be called from the component that has access to contextId
2614
3297
  this.documentStore = documentStore;
2615
3298
  this.documentService = documentService;
2616
3299
  this.documentQuery = documentQuery;
2617
3300
  this.documentHttpService = documentHttpService;
3301
+ this.documentHelperService = documentHelperService;
2618
3302
  }
2619
3303
  /**
2620
3304
  * Get contextId in input.
@@ -2622,31 +3306,22 @@ class DocumentContainerComponent {
2622
3306
  */
2623
3307
  contextId = SHARED.EMPTY;
2624
3308
  /**
2625
- * Get isCollapsed in input.
2626
- * @type {string}
2627
- */
2628
- isCollapsed = SHARED.FALSE;
2629
- /**
2630
- * Get showFolderList in input.
2631
- * @type {boolean}
2632
- */
2633
- showFolderList = SHARED.TRUE;
2634
- /**
2635
- * Get isUploadButtonVisible in input.
2636
- * @type {boolean}
3309
+ * The list of folders.
3310
+ * @type {Array}
2637
3311
  */
2638
- isUploadButtonVisible = SHARED.TRUE;
3312
+ applicationNumber = SHARED.EMPTY;
3313
+ catagories = SHARED.EMPTY_ARRAY;
3314
+ userList = SHARED.EMPTY_ARRAY;
2639
3315
  /**
2640
- * The list of documents.
2641
- * @type {Array}
3316
+ * Status data for the current selection
3317
+ * @type {StatusDataModel[]}
2642
3318
  */
2643
- documentList = [];
3319
+ statusData = [];
2644
3320
  /**
2645
- * The list of folders.
2646
- * @type {Array}
3321
+ * Document list response from API
3322
+ * @type {DocumentListResponse | null}
2647
3323
  */
2648
- folderList = SHARED.EMPTY_ARRAY;
2649
- items = SHARED.Menu;
3324
+ documentListResponse = null;
2650
3325
  /**
2651
3326
  * Holds the subscription to manage observable cleanup.
2652
3327
  * @private
@@ -2658,88 +3333,88 @@ class DocumentContainerComponent {
2658
3333
  * @returns {void}
2659
3334
  */
2660
3335
  ngOnInit() {
2661
- // this.fetchFolder();
2662
- const folderSubscription = this.documentQuery
2663
- .selectParentDocumentTypeId()
2664
- .subscribe((folderBlockId) => {
2665
- const validFolders = this.folderList.filter(folder => (folder.documentCount ?? 0) > 0);
2666
- const idToFetch = folderBlockId ?? validFolders[0]?._id;
2667
- if (idToFetch) {
2668
- // this.fetchDocuments(idToFetch);
2669
- }
2670
- else {
2671
- console.warn('No folders with documents available.');
2672
- }
2673
- });
2674
- this.subscription.add(folderSubscription);
3336
+ this.fetchDocumentCatagories();
3337
+ this.fetchUserList();
3338
+ this.setupStatusDataSubscriptions();
3339
+ this.setupFilteredDocumentSubscription();
3340
+ this.documentHelperService.initializeSelectionWatcherWithInitialLoad(this.contextId);
2675
3341
  }
2676
3342
  /**
2677
- * Fetches the folder data from the API.
2678
- * @returns {void}
3343
+ * Sets up subscriptions to monitor menu item and user selection changes
3344
+ * to trigger status data fetching
2679
3345
  */
3346
+ setupStatusDataSubscriptions() {
3347
+ this.subscription.add(this.documentQuery.selectSelectedMenuItem().subscribe(menuItem => {
3348
+ this.fetchStatusData();
3349
+ }));
3350
+ this.subscription.add(this.documentQuery.selectSelectedUserId().subscribe(userId => {
3351
+ this.fetchStatusData();
3352
+ }));
3353
+ this.fetchStatusData();
3354
+ }
2680
3355
  /**
2681
- * Fetches the folder data from the API.
2682
- * @returns {void}
3356
+ * Fetches status data based on current selections
2683
3357
  */
2684
- fetchFolder() {
2685
- const folderSubscription = this.documentHttpService.getFoldersData(this.contextId).subscribe({
2686
- /**
2687
- * Handles the successful API response.
2688
- * @param {FolderBlockModel[]} folder - The list of folders returned by the API.
2689
- */
2690
- next: (folder) => {
2691
- if (folder && folder.length > 0) {
2692
- this.folderList = folder.filter(f => (f.documentCount ?? 0) > 0);
2693
- if (this.folderList.length > 0) {
2694
- // this.fetchDocuments(this.folderList[0]._id);
2695
- }
2696
- else {
2697
- console.warn('No folders with documents found.');
2698
- }
2699
- }
2700
- else {
2701
- console.error(ERRORS.ERROR_ALLDOCUMENT_MISSING);
3358
+ fetchStatusData() {
3359
+ if (!this.contextId) {
3360
+ console.warn('Context ID is required to fetch status data');
3361
+ return;
3362
+ }
3363
+ const currentState = this.documentQuery.getSelectionState();
3364
+ const contextId = currentState.userId || this.contextId;
3365
+ const categoryId = currentState.menuItem || null;
3366
+ this.documentHttpService.getStatusDocumentCount(this.contextId, contextId, categoryId).subscribe({
3367
+ next: (statusData) => {
3368
+ this.statusData = statusData;
3369
+ this.documentStore.setStatusData(statusData);
3370
+ },
3371
+ error: (error) => {
3372
+ console.error('Error fetching status data:', error);
3373
+ }
3374
+ });
3375
+ }
3376
+ /**
3377
+ * Fetches document catagory data.
3378
+ */
3379
+ fetchDocumentCatagories() {
3380
+ const categoriesSubscription = this.documentHttpService.getDocumentCatagories(this.contextId).subscribe({
3381
+ next: (categories) => {
3382
+ if (categories) {
3383
+ this.catagories = categories.categories;
3384
+ this.applicationNumber = categories.applicationNumber;
2702
3385
  }
2703
3386
  },
2704
- /**
2705
- * Handles errors if the request fails.
2706
- * @param {any} err - The error object returned by the server.
2707
- */
2708
3387
  error: (err) => {
2709
- console.error(ERRORS.ERROR_DOCUMENT_TYPES, err);
3388
+ console.error('Error fetching document categories:', err);
2710
3389
  }
2711
3390
  });
2712
- this.subscription.add(folderSubscription);
3391
+ this.subscription.add(categoriesSubscription);
2713
3392
  }
2714
3393
  /**
2715
- * Fetches the document data from the API.
2716
- * @param {string} folderBlockId - The folder ID to fetch the document.
2717
- * @returns {void}
3394
+ * Fetches userlist data
2718
3395
  */
2719
- fetchDocuments(folderBlockId) {
2720
- const documentSubscription = this.documentHttpService.getDocumentByFolderID(folderBlockId, this.contextId).subscribe({
2721
- /**
2722
- * Handles the successful API response.
2723
- * @param {DocumentModel[]} documentList - The list of documents returned by the API.
2724
- */
2725
- next: (documentList) => {
2726
- if (documentList) {
2727
- this.documentList = documentList;
2728
- this.documentStore.setDocumentList(documentList);
2729
- }
2730
- else {
2731
- console.error(ERRORS.ERROR_FETCHING_DOCUMENTS);
2732
- }
3396
+ fetchUserList() {
3397
+ this.documentHttpService.getUserListByContextId(this.contextId).subscribe({
3398
+ next: (res) => {
3399
+ this.userList = res;
2733
3400
  },
2734
- /**
2735
- * Handles errors if the request fails.
2736
- * @param {any} err - The error object returned by the server.
2737
- */
2738
3401
  error: (err) => {
2739
- console.error(ERRORS.ERROR_FETCHING_DOCUMENTS, err);
3402
+ console.log(err);
2740
3403
  }
2741
3404
  });
2742
- this.subscription.add(documentSubscription);
3405
+ }
3406
+ /**
3407
+ * Sets up subscription to listen for filtered document responses
3408
+ */
3409
+ setupFilteredDocumentSubscription() {
3410
+ this.subscription.add(this.documentQuery.selectDocumentListResponse().subscribe({
3411
+ next: (response) => {
3412
+ this.documentListResponse = response;
3413
+ },
3414
+ error: (error) => {
3415
+ console.error('Error receiving filtered documents:', error);
3416
+ }
3417
+ }));
2743
3418
  }
2744
3419
  /**
2745
3420
  * Unsubscribe subscription on destroy of component .
@@ -2747,19 +3422,13 @@ class DocumentContainerComponent {
2747
3422
  ngOnDestroy() {
2748
3423
  this.subscription.unsubscribe();
2749
3424
  }
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 });
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"] }] });
3425
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, deps: [{ token: DocumentStore }, { token: DocumentService }, { token: DocumentQuery }, { token: DocumentHttpService }, { token: DocumentHelperService }], target: i0.ɵɵFactoryTarget.Component });
3426
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentContainerComponent, isStandalone: false, selector: "lib-document-container", inputs: { contextId: "contextId" }, ngImport: i0, template: "<div class=\"grid m-0 h-full flex\">\r\n <div class=\"col-12 md:col-3 lg:col-3\">\r\n <lib-documents-menu [catagories]=\"catagories\" [applicationNumber]=\"applicationNumber\" [contextId]=\"contextId\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" >\r\n <div>\r\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\r\n </div>\r\n <div >\r\n <lib-document-list [contextId]=\"contextId\" [documentListResponse]=\"documentListResponse\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"], dependencies: [{ kind: "component", type: FolderContainerComponent, selector: "lib-folder-container", inputs: ["documentList", "folderList", "contextId", "userList", "statusData", "categories"] }, { kind: "component", type: DocumentListComponent, selector: "lib-document-list", inputs: ["contextId", "documentListResponse", "isUploadButtonVisible", "documentList", "status", "category", "searchKey"] }, { kind: "component", type: DocumentsMenuComponent, selector: "lib-documents-menu", inputs: ["catagories", "applicationNumber", "contextId"] }] });
2752
3427
  }
2753
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentContainerComponent, decorators: [{
3428
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentContainerComponent, decorators: [{
2754
3429
  type: Component,
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"] }]
2756
- }], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentService$1 }, { type: DocumentQuery }, { type: DocumentHttpService }], propDecorators: { contextId: [{
2757
- type: Input
2758
- }], isCollapsed: [{
2759
- type: Input
2760
- }], showFolderList: [{
2761
- type: Input
2762
- }], isUploadButtonVisible: [{
3430
+ 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 [catagories]=\"catagories\" [applicationNumber]=\"applicationNumber\" [contextId]=\"contextId\"></lib-documents-menu>\r\n </div>\r\n <div class=\"col-12 md:col-9 lg:col-9 p-0 h-full\" >\r\n <div>\r\n <lib-folder-container [contextId]=\"contextId\" [userList]=\"userList\" [statusData]=\"statusData\" [categories]=\"catagories\"></lib-folder-container>\r\n </div>\r\n <div >\r\n <lib-document-list [contextId]=\"contextId\" [documentListResponse]=\"documentListResponse\">\r\n <ng-content></ng-content>\r\n </lib-document-list>\r\n </div>\r\n </div>\r\n</div>", styles: [".custom-scroll{overflow-y:hidden;scrollbar-gutter:stable}.custom-scroll:hover{overflow-y:auto}\n"] }]
3431
+ }], ctorParameters: () => [{ type: DocumentStore }, { type: DocumentService }, { type: DocumentQuery }, { type: DocumentHttpService }, { type: DocumentHelperService }], propDecorators: { contextId: [{
2763
3432
  type: Input
2764
3433
  }] } });
2765
3434
 
@@ -2802,10 +3471,10 @@ class FolderBlockComponent {
2802
3471
  this.documentStore.setParentDocumentTypeId(folderBlockId);
2803
3472
  return folderBlockId;
2804
3473
  }
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"] }] });
3474
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderBlockComponent, deps: [{ token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
3475
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: FolderBlockComponent, isStandalone: false, selector: "lib-folder-block", inputs: { folderList: "folderList" }, ngImport: i0, template: "<div class=\"card p-0 folder-info\">\r\n <div class=\"text-900 text-xl font-semibold ml-2 mb-1\">Folders</div>\r\n <div class=\"grid m-0\">\r\n <div *ngFor=\"let folder of folderList\" class=\"col-12 md:col-6 xl:col-4 container-wrapper\">\r\n <div\r\n class=\"p-3 border-1 h-full surface-border flex flex-column justify-content-between hover:surface-100 cursor-pointer border-round\"\r\n (click)=\"handleClickForFilter(folder._id)\"\r\n >\r\n <div class=\"icon\">\r\n <img src=\"../../../../assets/images/FolderImg.png\" alt=\"\" />\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span class=\"text-600 mt-2\"> {{ folder.documentCount }} Files </span>\r\n <span class=\"text-900 text-lg mt-2 mb-2 font-semibold font-medium\">\r\n {{ folder.folderName }}\r\n </span>\r\n </div>\r\n <hr />\r\n <div class=\"flex justify-content-between\">\r\n <div class=\"flex flex-column\">\r\n <span>Missing</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-pink-500': missingFileCount > 0,\r\n 'text-green-500': missingFileCount === 0\r\n }\"\r\n >\r\n {{ missingFileCount }}\r\n </span>\r\n </div>\r\n <div class=\"flex flex-column\">\r\n <span>Pending</span>\r\n <span\r\n [ngClass]=\"{\r\n 'text-yellow-500': pendingFileCount > 0,\r\n 'text-green-500': pendingFileCount === 0\r\n }\"\r\n >\r\n {{ pendingFileCount }}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container-wrapper:nth-child(3n+1){padding-left:0}.container-wrapper:nth-child(3n){padding-right:0}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
2807
3476
  }
2808
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FolderBlockComponent, decorators: [{
3477
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: FolderBlockComponent, decorators: [{
2809
3478
  type: Component,
2810
3479
  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
3480
  }], ctorParameters: () => [{ type: DocumentStore }], propDecorators: { folderList: [{
@@ -2840,10 +3509,10 @@ class DocumentListItemComponent {
2840
3509
  }
2841
3510
  this.documentClick.emit(document);
2842
3511
  }
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"] }] });
3512
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3513
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentListItemComponent, isStandalone: false, selector: "lib-document-list-item", inputs: { document: "document" }, outputs: { documentClick: "documentClick" }, ngImport: i0, template: "<div class=\"grid m-0\">\r\n <div\r\n class=\"col-12 flex align-items-center justify-content-between md:col-12 xl:col-12\"\r\n >\r\n <div\r\n class=\"col-5 flex cursor-pointer align-items-center pl-0\"\r\n (click)=\"handleOpenDocument(document)\"\r\n >\r\n <img src=\"../../../../assets/images/Frame.png\" alt=\"\" />\r\n <span class=\"ml-4 file-name-wrapper document-text-wrapper\">{{ document.fileName }}</span>\r\n </div>\r\n <div class=\"col-4 flex align-items-center justify-content-center\">\r\n <span\r\n [class]=\"'product-badge status-' + document.status?.toLowerCase()\"\r\n class=\"flex align-items-center justify-content-center pl-2 pr-2 pt-1 pb-1\"\r\n >\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'pending'\">\r\n <i class=\"pi pi-clock pr-1\" style=\"font-size: 12px;\"></i>\r\n Pending\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'verified'\">\r\n <i class=\"pi pi-check-circle pr-1\" style=\"font-size: 12px;\"></i>\r\n Verified\r\n </ng-container>\r\n <ng-container *ngIf=\"document.status?.toLowerCase() === 'alert'\">\r\n <i class=\"pi pi-bell pr-1\" style=\"font-size: 12px;\"></i>\r\n Alert\r\n </ng-container>\r\n </span>\r\n </div>\r\n <div class=\"document-type file-name-wrapper document-text-wrapper\">\r\n {{document.documentTypeName}}\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".product-badge.status-pending{background:#e9b127;color:#fff;border-radius:4px}.product-badge.status-verified{background:#4caf50;color:#fff;border-radius:4px}.product-badge.status-alert{background:#f57c00;color:#fff;border-radius:4px}.product-badge{text-transform:none;font-weight:500;font-size:12px}.file-name-wrapper{font-size:15px;font-weight:500}.document-text-wrapper{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2845
3514
  }
2846
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentListItemComponent, decorators: [{
3515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentListItemComponent, decorators: [{
2847
3516
  type: Component,
2848
3517
  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
3518
  }], propDecorators: { documentClick: [{
@@ -2878,10 +3547,10 @@ class GlobalErrorHandler {
2878
3547
  handleError(error) {
2879
3548
  console.error('GlobalErrorHandler:', error);
2880
3549
  }
2881
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
2882
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GlobalErrorHandler });
3550
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
3551
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: GlobalErrorHandler });
2883
3552
  }
2884
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GlobalErrorHandler, decorators: [{
3553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: GlobalErrorHandler, decorators: [{
2885
3554
  type: Injectable
2886
3555
  }], ctorParameters: () => [{ type: i0.Injector }] });
2887
3556
 
@@ -2909,16 +3578,16 @@ class DocumentDirective {
2909
3578
  }
2910
3579
  });
2911
3580
  }
2912
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentDirective, deps: [{ token: DocumentService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
2913
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.5", type: DocumentDirective, isStandalone: false, selector: "[doc]", ngImport: i0 });
3581
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentDirective, deps: [{ token: DocumentHelperService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
3582
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: DocumentDirective, isStandalone: false, selector: "[doc]", ngImport: i0 });
2914
3583
  }
2915
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentDirective, decorators: [{
3584
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentDirective, decorators: [{
2916
3585
  type: Directive,
2917
3586
  args: [{
2918
3587
  selector: '[doc]',
2919
3588
  standalone: false
2920
3589
  }]
2921
- }], ctorParameters: () => [{ type: DocumentService }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
3590
+ }], ctorParameters: () => [{ type: DocumentHelperService }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
2922
3591
 
2923
3592
  /**
2924
3593
  * Service for managing user session details.
@@ -2984,10 +3653,10 @@ class SessionService {
2984
3653
  clearSession() {
2985
3654
  localStorage.clear();
2986
3655
  }
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' });
3656
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
3657
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, providedIn: 'root' });
2989
3658
  }
2990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SessionService, decorators: [{
3659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SessionService, decorators: [{
2991
3660
  type: Injectable,
2992
3661
  args: [{
2993
3662
  providedIn: 'root'
@@ -3047,10 +3716,10 @@ class HasPermissionDirective {
3047
3716
  this.renderer.removeStyle(this.el.nativeElement, 'display');
3048
3717
  }
3049
3718
  }
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 });
3719
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SessionService }], target: i0.ɵɵFactoryTarget.Directive });
3720
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.14", type: HasPermissionDirective, isStandalone: false, selector: "[permission]", inputs: { permission: "permission" }, usesOnChanges: true, ngImport: i0 });
3052
3721
  }
3053
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: HasPermissionDirective, decorators: [{
3722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: HasPermissionDirective, decorators: [{
3054
3723
  type: Directive,
3055
3724
  args: [{
3056
3725
  selector: '[permission]',
@@ -3061,17 +3730,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
3061
3730
  }] } });
3062
3731
 
3063
3732
  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,
3733
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3734
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, declarations: [TablePrimaryComponent], imports: [CommonModule,
3066
3735
  TableModule,
3067
3736
  ButtonModule,
3068
3737
  RippleModule], exports: [TablePrimaryComponent] });
3069
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SharedModule, imports: [CommonModule,
3738
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, imports: [CommonModule,
3070
3739
  TableModule,
3071
3740
  ButtonModule,
3072
3741
  RippleModule] });
3073
3742
  }
3074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SharedModule, decorators: [{
3743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: SharedModule, decorators: [{
3075
3744
  type: NgModule,
3076
3745
  args: [{
3077
3746
  declarations: [TablePrimaryComponent],
@@ -3093,8 +3762,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
3093
3762
  * document lists, and individual document items.
3094
3763
  */
3095
3764
  class DocumentModule {
3096
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3097
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, declarations: [
3765
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3766
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: DocumentModule, declarations: [
3098
3767
  /**
3099
3768
  * The main container for managing documents.
3100
3769
  * DocumentContainerComponent
@@ -3237,7 +3906,7 @@ class DocumentModule {
3237
3906
  * A directive to show the document.
3238
3907
  */
3239
3908
  DocumentDirective] });
3240
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, providers: [
3909
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentModule, providers: [
3241
3910
  /**
3242
3911
  * Provide the messageservice to be used in other components.
3243
3912
  */
@@ -3343,7 +4012,7 @@ class DocumentModule {
3343
4012
  TableModule,
3344
4013
  SharedModule] });
3345
4014
  }
3346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DocumentModule, decorators: [{
4015
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentModule, decorators: [{
3347
4016
  type: NgModule,
3348
4017
  args: [{
3349
4018
  declarations: [