cat-documents-ng 0.2.35 → 0.2.38

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.
@@ -0,0 +1,43 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DocumentHistoryItem, DocumentHistorySection } from '../../models/document-history.model';
3
+ import { DocumentHistoryStyleService } from '../../services/document-history-style.service';
4
+ import * as i0 from "@angular/core";
5
+ interface ProcessedDocumentHistoryItem extends DocumentHistoryItem {
6
+ actionIcon: string;
7
+ actionColor: string;
8
+ actionBgColor: string;
9
+ actionBorderColor: string;
10
+ actionIconBgColor: string;
11
+ }
12
+ interface ProcessedDocumentHistorySection extends DocumentHistorySection {
13
+ list: ProcessedDocumentHistoryItem[];
14
+ }
15
+ /**
16
+ * Component for displaying document history in a timeline format.
17
+ */
18
+ export declare class DocumentHistoryComponent implements OnInit {
19
+ private documentHistoryStyleService;
20
+ /**
21
+ * Input data for document history sections
22
+ */
23
+ historyData: DocumentHistorySection[];
24
+ /**
25
+ * Whether to show the history component
26
+ */
27
+ showHistory: boolean;
28
+ constructor(documentHistoryStyleService: DocumentHistoryStyleService);
29
+ ngOnInit(): void;
30
+ /**
31
+ * Process history data to add computed properties
32
+ */
33
+ get processedHistoryData(): ProcessedDocumentHistorySection[];
34
+ /**
35
+ * Downloads a document when clicked
36
+ * @param documentUrl - The URL of the document to download
37
+ * @param docName - The name of the document
38
+ */
39
+ downloadDocument(documentUrl: string, docName?: string): void;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentHistoryComponent, "document-history", never, { "historyData": { "alias": "historyData"; "required": false; }; "showHistory": { "alias": "showHistory"; "required": false; }; }, {}, never, never, false, never>;
42
+ }
43
+ export {};
@@ -6,8 +6,8 @@ import { DocumentQuery } from '../../state/document.query';
6
6
  import { DocumentStore } from '../../state/document.store';
7
7
  import { PERMISSIONS } from '../../../../Shared/constant/PERMISSIONS';
8
8
  import { DocumentTableBuilderService } from '../../services/document-table-builder.service';
9
- import { TableData } from '../../../../Shared/components/table-primary/table-primary.component';
10
9
  import { DocumentListItem, DocumentListResponse } from '../../models/document-list-response.model';
10
+ import { TableData } from '../../../../Shared/components/table-primary/table-primary.model';
11
11
  import * as i0 from "@angular/core";
12
12
  /**
13
13
  * This component is responsible for displaying and managing a list of documents.
@@ -110,6 +110,10 @@ export declare class DocumentListComponent implements OnInit, OnDestroy {
110
110
  * Document categories from the response
111
111
  */
112
112
  documentCategories: DocumentListResponse[];
113
+ /**
114
+ * Completion counts for each category
115
+ */
116
+ categoryCompletionCounts: string[];
113
117
  /**
114
118
  * Filter properties
115
119
  */
@@ -158,10 +162,6 @@ export declare class DocumentListComponent implements OnInit, OnDestroy {
158
162
  */
159
163
  getDocumentTypeList(): void;
160
164
  handleOpenSideBar(isVisible: boolean): void;
161
- /**
162
- * Builds table data for all document categories
163
- */
164
- private buildCategoryTables;
165
165
  /**
166
166
  * Gets completion count for a category
167
167
  */
@@ -9,13 +9,13 @@ export declare class DocumentStatusComponent implements OnInit, OnDestroy {
9
9
  private statusCalculatorService;
10
10
  contextId: string;
11
11
  statusData: any;
12
- selectedStatusId: string | null;
12
+ selectedStatus: string | null;
13
13
  statusDataWithPercentages: CalculatedStatusData[];
14
14
  private subscription;
15
15
  constructor(documentQuery: DocumentQuery, documentService: DocumentHelperService, statusCalculatorService: StatusCalculatorService);
16
16
  ngOnInit(): void;
17
17
  ngOnDestroy(): void;
18
- selectStatus(statusId: string): void;
18
+ selectStatus(status: string): void;
19
19
  private updateCalculatedStatusData;
20
20
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStatusComponent, never>;
21
21
  static ɵcmp: i0.ɵɵComponentDeclaration<DocumentStatusComponent, "lib-document-status", never, { "contextId": { "alias": "contextId"; "required": false; }; "statusData": { "alias": "statusData"; "required": false; }; }, {}, never, never, false, never>;
@@ -3,6 +3,7 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
3
3
  import { DocumentHttpService } from '../../services/document-http.service';
4
4
  import { DocumentHelperService } from '../../services/document.service';
5
5
  import { DocumentListItem } from '../../models/document-list-response.model';
6
+ import { DocumentHistorySection } from '../../models/document-history.model';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * Component for viewing and managing document details.
@@ -42,6 +43,16 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
42
43
  * @type {any}
43
44
  */
44
45
  alertData: any;
46
+ /**
47
+ * Document history data
48
+ * @type {DocumentHistorySection[]}
49
+ */
50
+ documentHistory: DocumentHistorySection[];
51
+ /**
52
+ * Whether to show document history
53
+ * @type {boolean}
54
+ */
55
+ showDocumentHistory: boolean;
45
56
  /**
46
57
  * Holds the subscription to manage observable cleanup.
47
58
  * @private
@@ -60,6 +71,11 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
60
71
  */
61
72
  ngOnChanges(): void;
62
73
  handleSelectedDocument(document: DocumentListItem): void;
74
+ /**
75
+ * Loads document history data
76
+ * @returns {void}
77
+ */
78
+ loadDocumentHistory(documentId: string): void;
63
79
  /**
64
80
  * Determines if the given content type is an image.
65
81
  * @param {string | undefined} contentType - The MIME type of the content.
@@ -6,34 +6,35 @@ import * as i4 from "./components/document-list/document-list.component";
6
6
  import * as i5 from "./components/document-list-item/document-list-item.component";
7
7
  import * as i6 from "./components/document-upload/document-upload.component";
8
8
  import * as i7 from "./components/document-viewer/document-viewer.component";
9
- import * as i8 from "./directives/document.directive";
10
- import * as i9 from "./directives/permission.directive";
11
- import * as i10 from "./components/linked-document/linked-document.component";
12
- import * as i11 from "./components/documents-menu/documents-menu.component";
13
- import * as i12 from "./components/user-list/user-list.component";
14
- import * as i13 from "./components/document-status/document-status.component";
15
- import * as i14 from "@angular/common";
16
- import * as i15 from "primeng/accordion";
17
- import * as i16 from "@angular/common/http";
18
- import * as i17 from "primeng/button";
19
- import * as i18 from "primeng/sidebar";
20
- import * as i19 from "primeng/fileupload";
21
- import * as i20 from "primeng/progressbar";
22
- import * as i21 from "primeng/badge";
23
- import * as i22 from "primeng/listbox";
24
- import * as i23 from "primeng/checkbox";
25
- import * as i24 from "primeng/timeline";
26
- import * as i25 from "primeng/inputtextarea";
27
- import * as i26 from "@angular/forms";
28
- import * as i27 from "ng2-pdf-viewer";
29
- import * as i28 from "primeng/dialog";
30
- import * as i29 from "primeng/dropdown";
31
- import * as i30 from "primeng/inputtext";
32
- import * as i31 from "primeng/menu";
33
- import * as i32 from "primeng/panelmenu";
34
- import * as i33 from "primeng/card";
35
- import * as i34 from "primeng/table";
36
- import * as i35 from "../../Shared/shared.module";
9
+ import * as i8 from "./components/document-history/document-history.component";
10
+ import * as i9 from "./directives/document.directive";
11
+ import * as i10 from "./directives/permission.directive";
12
+ import * as i11 from "./components/linked-document/linked-document.component";
13
+ import * as i12 from "./components/documents-menu/documents-menu.component";
14
+ import * as i13 from "./components/user-list/user-list.component";
15
+ import * as i14 from "./components/document-status/document-status.component";
16
+ import * as i15 from "@angular/common";
17
+ import * as i16 from "primeng/accordion";
18
+ import * as i17 from "@angular/common/http";
19
+ import * as i18 from "primeng/button";
20
+ import * as i19 from "primeng/sidebar";
21
+ import * as i20 from "primeng/fileupload";
22
+ import * as i21 from "primeng/progressbar";
23
+ import * as i22 from "primeng/badge";
24
+ import * as i23 from "primeng/listbox";
25
+ import * as i24 from "primeng/checkbox";
26
+ import * as i25 from "primeng/timeline";
27
+ import * as i26 from "primeng/inputtextarea";
28
+ import * as i27 from "@angular/forms";
29
+ import * as i28 from "ng2-pdf-viewer";
30
+ import * as i29 from "primeng/dialog";
31
+ import * as i30 from "primeng/dropdown";
32
+ import * as i31 from "primeng/inputtext";
33
+ import * as i32 from "primeng/menu";
34
+ import * as i33 from "primeng/panelmenu";
35
+ import * as i34 from "primeng/card";
36
+ import * as i35 from "primeng/table";
37
+ import * as i36 from "../../Shared/shared.module";
37
38
  /**
38
39
  * @module DocumentModule
39
40
  *
@@ -43,6 +44,6 @@ import * as i35 from "../../Shared/shared.module";
43
44
  */
44
45
  export declare class DocumentModule {
45
46
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
46
- static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentDirective, typeof i9.HasPermissionDirective, typeof i10.LinkedDocumentComponent, typeof i11.DocumentsMenuComponent, typeof i12.UserListComponent, typeof i13.DocumentStatusComponent], [typeof i14.CommonModule, typeof i15.AccordionModule, typeof i16.HttpClientModule, typeof i17.ButtonModule, typeof i18.SidebarModule, typeof i19.FileUploadModule, typeof i20.ProgressBarModule, typeof i21.BadgeModule, typeof i22.ListboxModule, typeof i23.CheckboxModule, typeof i24.TimelineModule, typeof i25.InputTextareaModule, typeof i26.FormsModule, typeof i27.PdfViewerModule, typeof i28.DialogModule, typeof i29.DropdownModule, typeof i30.InputTextModule, typeof i31.MenuModule, typeof i32.PanelMenuModule, typeof i33.CardModule, typeof i34.TableModule, typeof i35.SharedModule], [typeof i9.HasPermissionDirective, typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i4.DocumentListComponent, typeof i8.DocumentDirective]>;
47
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentDirective, typeof i10.HasPermissionDirective, typeof i11.LinkedDocumentComponent, typeof i12.DocumentsMenuComponent, typeof i13.UserListComponent, typeof i14.DocumentStatusComponent], [typeof i15.CommonModule, typeof i16.AccordionModule, typeof i17.HttpClientModule, typeof i18.ButtonModule, typeof i19.SidebarModule, typeof i20.FileUploadModule, typeof i21.ProgressBarModule, typeof i22.BadgeModule, typeof i23.ListboxModule, typeof i24.CheckboxModule, typeof i25.TimelineModule, typeof i26.InputTextareaModule, typeof i27.FormsModule, typeof i28.PdfViewerModule, typeof i29.DialogModule, typeof i30.DropdownModule, typeof i31.InputTextModule, typeof i32.MenuModule, typeof i33.PanelMenuModule, typeof i34.CardModule, typeof i35.TableModule, typeof i36.SharedModule], [typeof i10.HasPermissionDirective, typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective]>;
47
48
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
48
49
  }
@@ -1,8 +1,12 @@
1
1
  export interface DocumentCategoryStatus {
2
- Pending: number;
3
- Reviewing: number;
4
- Accepted: number;
5
- Rejected: number;
2
+ Pending?: number;
3
+ Reviewing?: number;
4
+ Accepted?: number;
5
+ Rejected?: number;
6
+ pending?: number;
7
+ reviewing?: number;
8
+ approved?: number;
9
+ rejected?: number;
6
10
  }
7
11
  export interface DocumentCategoryItem {
8
12
  _id: string;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Represents a document history item.
3
+ */
4
+ export interface DocumentHistoryItem {
5
+ /**
6
+ * The label/action type (e.g., "Document Uploaded", "Document Rejected", "Document Accepted")
7
+ */
8
+ label: string;
9
+ /**
10
+ * The date and time of the action
11
+ */
12
+ dateTime: string;
13
+ /**
14
+ * Description or comment for the action
15
+ */
16
+ requestDescription: string;
17
+ /**
18
+ * URL of the document (optional)
19
+ */
20
+ documentUrl?: string;
21
+ /**
22
+ * Name of the document (optional)
23
+ */
24
+ docName?: string;
25
+ /**
26
+ * Name of the user who performed the action
27
+ */
28
+ userName: string;
29
+ /**
30
+ * Role of the user who performed the action
31
+ */
32
+ userRole: string;
33
+ actionColor: string;
34
+ actionIcon: string;
35
+ actionIconBgColor: string;
36
+ actionBgColor: string;
37
+ actionBorderColor: string;
38
+ }
39
+ /**
40
+ * Represents a document history section with header and list of items.
41
+ */
42
+ export interface DocumentHistorySection {
43
+ /**
44
+ * The header/title of the section (e.g., "Initial Request", "Document History")
45
+ */
46
+ header: string;
47
+ /**
48
+ * List of history items in this section
49
+ */
50
+ list: DocumentHistoryItem[];
51
+ }
52
+ /**
53
+ * Represents the complete document history response.
54
+ */
55
+ export interface DocumentHistoryResponse {
56
+ /**
57
+ * Array of document history sections
58
+ */
59
+ sections: DocumentHistorySection[];
60
+ }
@@ -10,6 +10,7 @@ export interface DocumentListItem {
10
10
  status: string;
11
11
  uploadedOn: string;
12
12
  ownerName: string;
13
+ contentType: string;
13
14
  }
14
15
  /**
15
16
  * Represents the complete document list response
@@ -0,0 +1,29 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Service for handling document history styling logic
4
+ */
5
+ export declare class DocumentHistoryStyleService {
6
+ constructor();
7
+ /**
8
+ * Get the appropriate icon class based on the action label
9
+ */
10
+ getActionIcon(label: string): string;
11
+ /**
12
+ * Get the appropriate color class based on the action label
13
+ */
14
+ getActionColor(label: string): string;
15
+ /**
16
+ * Get the appropriate background color class based on the action label
17
+ */
18
+ getActionBgColor(label: string): string;
19
+ /**
20
+ * Get the appropriate border color class based on the action label
21
+ */
22
+ getActionBorderColor(label: string): string;
23
+ /**
24
+ * Get the appropriate icon background color class based on the action label
25
+ */
26
+ getActionIconBgColor(label: string): string;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryStyleService, never>;
28
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHistoryStyleService>;
29
+ }
@@ -9,6 +9,7 @@ import { FolderBlockModel } from '../models/folder.model';
9
9
  import { DocumentCategory } from '../models/document-category.model';
10
10
  import { UserListModel } from '../models/user-list.model';
11
11
  import { StatusDataModel } from '../models/status-data.model';
12
+ import { DocumentHistorySection } from '../models/document-history.model';
12
13
  import * as i0 from "@angular/core";
13
14
  /**
14
15
  * Service for making HTTP requests related to documents.
@@ -99,6 +100,7 @@ export declare class DocumentHttpService {
99
100
  * @returns {Observable<any>} An observable that emits the filtered document data.
100
101
  */
101
102
  getDocumentsBySelection(contextId: string, menuItem: string | null, userId: string | null, status: string | null, searchKey?: string | null): Observable<any>;
103
+ getDocumentHistory(documentId: string): Observable<DocumentHistorySection[]>;
102
104
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHttpService, never>;
103
105
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHttpService>;
104
106
  }
@@ -1,26 +1,8 @@
1
- import { TableData } from '../../../Shared/components/table-primary/table-primary.component';
2
1
  import { DocumentListResponse, DocumentListItem } from '../models/document-list-response.model';
2
+ import { TableData } from '../../../Shared/components/table-primary/table-primary.model';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class DocumentTableBuilderService {
5
5
  constructor();
6
- /**
7
- * Gets document type from file name extension
8
- * @param fileName File name with extension
9
- * @returns Document type string
10
- */
11
- private getDocumentTypeFromFileName;
12
- /**
13
- * Builds table data for document categories
14
- * @param categories Array of document categories
15
- * @returns Array of TableData objects
16
- */
17
- buildDocumentCategoriesTables(categories: DocumentListResponse[]): TableData[];
18
- /**
19
- * Builds table data for a single document category
20
- * @param category Document category
21
- * @returns TableData object
22
- */
23
- private buildTableForCategory;
24
6
  /**
25
7
  * Builds a single table from document list items
26
8
  * @param documents Array of document list items
@@ -14,7 +14,7 @@ export interface CalculatedStatusData extends StatusData {
14
14
  }
15
15
  export declare class StatusCalculatorService {
16
16
  calculateTotalCount(statusData: StatusData[]): number;
17
- calculateStatusDataWithPercentages(statusData: StatusData[], selectedStatusId: string | null): CalculatedStatusData[];
17
+ calculateStatusDataWithPercentages(statusData: StatusData[], selectedStatus: string | null): CalculatedStatusData[];
18
18
  static ɵfac: i0.ɵɵFactoryDeclaration<StatusCalculatorService, never>;
19
19
  static ɵprov: i0.ɵɵInjectableDeclaration<StatusCalculatorService>;
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.2.35",
3
+ "version": "0.2.38",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
package/public-api.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from './lib/document/document.module';
2
2
  export * from './lib/document/components/document-container/document-container.component';
3
3
  export * from './lib/document/components/document-viewer/document-viewer.component';
4
+ export * from './lib/document/components/document-history/document-history.component';
4
5
  export * from './lib/document/components/document-list/document-list.component';
6
+ export * from './lib/document/models/document-history.model';
5
7
  export * from './lib/document/services/document-table-builder.service';
6
8
  export * from './lib/document/directives/document.directive';
7
9
  export * from './lib/document/directives/permission.directive';