cat-documents-ng 0.3.41 → 0.3.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,11 @@
1
1
  import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { SHARED } from '../../../../Shared/constant/SHARED';
3
3
  import { DocumentActionsService, DocumentAction } from '../../services/document-actions.service';
4
- import { ConfirmationService } from 'primeng/api';
5
4
  import { SessionService } from '../../../../Shared/services/session.service';
6
5
  import * as i0 from "@angular/core";
7
6
  export declare class DocumentActionsComponent implements OnChanges {
8
7
  private documentActionsService;
9
8
  private sessionService;
10
- private confirmationService;
11
9
  readonly SHARED: typeof SHARED;
12
10
  document?: any;
13
11
  documentId?: string;
@@ -28,9 +26,8 @@ export declare class DocumentActionsComponent implements OnChanges {
28
26
  acceptButtonClass: string;
29
27
  isRejectNoteEmpty: boolean;
30
28
  showApproveRejectActions: boolean;
31
- showDeleteAction: boolean;
32
29
  showNoActions: boolean;
33
- constructor(documentActionsService: DocumentActionsService, sessionService: SessionService, confirmationService: ConfirmationService);
30
+ constructor(documentActionsService: DocumentActionsService, sessionService: SessionService);
34
31
  get rejectNote(): string;
35
32
  set rejectNote(value: string);
36
33
  /**
@@ -73,7 +70,6 @@ export declare class DocumentActionsComponent implements OnChanges {
73
70
  private resetActionFlags;
74
71
  onAcceptClick(): void;
75
72
  onRejectClick(): void;
76
- onDeleteClick(): void;
77
73
  onAcceptConfirm(): void;
78
74
  onRejectConfirm(): void;
79
75
  onCancel(): void;
@@ -1,30 +1,18 @@
1
- import { DocumentHistorySection } from '../../models/document-history.model';
1
+ import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { DocumentHistorySection, HistoryDocument } from '../../models/document-history.model';
2
3
  import { DocumentHistoryService } from '../../services/document-history.service';
4
+ import { DocumentViewerService } from '../../services/document-viewer.service';
5
+ import { DocumentActionsService } from '../../services/document-actions.service';
6
+ import { ConfirmationService } from 'primeng/api';
3
7
  import * as i0 from "@angular/core";
4
- interface ProcessedDocumentHistoryItem {
5
- label: string;
6
- dateTime: string;
7
- requestDescription: string;
8
- userName: string;
9
- userRole: string;
10
- documentUrl?: string;
11
- docName?: string;
12
- actionIcon: string;
13
- actionColor: string;
14
- actionBgColor: string;
15
- actionBorderColor: string;
16
- actionIconBgColor: string;
17
- }
18
- interface ProcessedDocumentHistorySection extends DocumentHistorySection {
19
- list: ProcessedDocumentHistoryItem[];
20
- accordionClass?: string;
21
- hasValidContent?: boolean;
22
- }
23
8
  /**
24
9
  * Component for displaying document history in a timeline format.
25
10
  */
26
- export declare class DocumentHistoryComponent {
11
+ export declare class DocumentHistoryComponent implements OnChanges {
27
12
  private documentHistoryService;
13
+ private documentViewerService;
14
+ private documentActionsService;
15
+ private confirmationService;
28
16
  /**
29
17
  * Input data for document history sections
30
18
  */
@@ -33,6 +21,30 @@ export declare class DocumentHistoryComponent {
33
21
  * Whether to show the history component
34
22
  */
35
23
  showHistory: boolean;
24
+ /**
25
+ * The context ID for API calls
26
+ */
27
+ contextId?: string;
28
+ /**
29
+ * The selected document for actions
30
+ */
31
+ selectedDocument?: any;
32
+ /**
33
+ * Event emitted when change document type is requested
34
+ */
35
+ changeDocumentTypeRequested: EventEmitter<void>;
36
+ /**
37
+ * Event emitted when delete task is requested
38
+ */
39
+ deleteTaskRequested: EventEmitter<void>;
40
+ /**
41
+ * Event emitted when a document from history is selected
42
+ */
43
+ documentSelected: EventEmitter<HistoryDocument>;
44
+ /**
45
+ * Reference to the document actions component
46
+ */
47
+ documentActionsComponent?: any;
36
48
  /**
37
49
  * Active accordion index for controlling expand/collapse
38
50
  */
@@ -41,7 +53,19 @@ export declare class DocumentHistoryComponent {
41
53
  * Whether the accordion is expanded
42
54
  */
43
55
  isAccordionExpanded: boolean;
44
- constructor(documentHistoryService: DocumentHistoryService);
56
+ /**
57
+ * Whether the actions dropdown menu is visible
58
+ */
59
+ showActionsMenu: boolean;
60
+ /**
61
+ * Whether to show the change document type content
62
+ */
63
+ showChangeDocumentType: boolean;
64
+ constructor(documentHistoryService: DocumentHistoryService, documentViewerService: DocumentViewerService, documentActionsService: DocumentActionsService, confirmationService: ConfirmationService);
65
+ /**
66
+ * Handles changes to input properties
67
+ */
68
+ ngOnChanges(changes: SimpleChanges): void;
45
69
  /**
46
70
  * Handle accordion open event
47
71
  */
@@ -57,14 +81,78 @@ export declare class DocumentHistoryComponent {
57
81
  /**
58
82
  * Process history data to add computed properties
59
83
  */
60
- get processedHistoryData(): ProcessedDocumentHistorySection[];
84
+ get processedHistoryData(): any[];
61
85
  /**
62
86
  * Downloads a document when clicked
63
87
  * @param documentUrl - The URL of the document to download
64
88
  * @param docName - The name of the document
65
89
  */
66
90
  downloadDocument(documentUrl: string, docName?: string): void;
91
+ /**
92
+ * Get alert count for the alerts section
93
+ */
94
+ getAlertCount(): number;
95
+ /**
96
+ * Get CSS class for event card based on action type
97
+ */
98
+ getEventCardClass(label: string): string;
99
+ /**
100
+ * Get CSS class for event icon based on action type
101
+ */
102
+ getEventIconClass(label: string): string;
103
+ /**
104
+ * Get the appropriate icon for the event
105
+ * @param label - The event label
106
+ * @returns {string} The icon class
107
+ */
108
+ getEventIcon(label: string): string;
109
+ /**
110
+ * Toggle the actions dropdown menu
111
+ */
112
+ toggleActionsMenu(): void;
113
+ /**
114
+ * Close the actions dropdown menu
115
+ */
116
+ closeActionsMenu(): void;
117
+ /**
118
+ * Handle change document type action
119
+ */
120
+ onChangeDocumentType(): void;
121
+ /**
122
+ * Close the change document type form
123
+ */
124
+ closeChangeDocumentType(): void;
125
+ /**
126
+ * Handle delete task action
127
+ */
128
+ onDeleteTask(): void;
129
+ /**
130
+ * Set reference to document actions component
131
+ */
132
+ setDocumentActionsComponent(component: any): void;
133
+ /**
134
+ * Handles document selection from history
135
+ * @param document - The selected document from history
136
+ */
137
+ onDocumentClick(document: HistoryDocument): void;
138
+ /**
139
+ * Processed history data with document lists
140
+ */
141
+ private _processedHistoryData;
142
+ /**
143
+ * Processes history data to include document lists for each item
144
+ */
145
+ private processHistoryData;
146
+ /**
147
+ * Gets the list of valid documents for a history item
148
+ * @param item - The history item
149
+ * @returns Array of valid documents
150
+ */
151
+ private getValidDocuments;
152
+ /**
153
+ * Listen for clicks outside the dropdown to close it
154
+ */
155
+ onDocumentClickOutside(event: Event): void;
67
156
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryComponent, never>;
68
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentHistoryComponent, "document-history", never, { "historyData": { "alias": "historyData"; "required": false; }; "showHistory": { "alias": "showHistory"; "required": false; }; }, {}, never, never, false, never>;
157
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentHistoryComponent, "document-history", never, { "historyData": { "alias": "historyData"; "required": false; }; "showHistory": { "alias": "showHistory"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; "selectedDocument": { "alias": "selectedDocument"; "required": false; }; }, { "changeDocumentTypeRequested": "changeDocumentTypeRequested"; "deleteTaskRequested": "deleteTaskRequested"; "documentSelected": "documentSelected"; }, never, ["document-actions", "*"], false, never>;
69
158
  }
70
- export {};
@@ -104,6 +104,19 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
104
104
  * Handles document name update event from content viewer
105
105
  */
106
106
  onDocumentNameUpdated(): void;
107
+ /**
108
+ * Handles change document type request from history component
109
+ */
110
+ onChangeDocumentTypeRequested(): void;
111
+ /**
112
+ * Handles delete task request from history component
113
+ */
114
+ onDeleteTaskRequested(): void;
115
+ /**
116
+ * Handles document selection from history component
117
+ * @param document - The selected document from history
118
+ */
119
+ onDocumentSelected(document: any): void;
107
120
  /**
108
121
  * Refreshes document data when the viewer is closed
109
122
  */
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Represents a document in the history item.
3
+ */
4
+ export interface HistoryDocument {
5
+ /**
6
+ * Name of the document
7
+ */
8
+ docName: string | null;
9
+ /**
10
+ * URL of the document
11
+ */
12
+ documentUrl: string | null;
13
+ /**
14
+ * Content type of the document
15
+ */
16
+ contentType: string | null;
17
+ }
1
18
  /**
2
19
  * Represents a document history item.
3
20
  */
@@ -15,13 +32,17 @@ export interface DocumentHistoryItem {
15
32
  */
16
33
  requestDescription: string;
17
34
  /**
18
- * URL of the document (optional)
35
+ * URL of the document (optional) - legacy field
19
36
  */
20
37
  documentUrl?: string;
21
38
  /**
22
- * Name of the document (optional)
39
+ * Name of the document (optional) - legacy field
23
40
  */
24
41
  docName?: string;
42
+ /**
43
+ * Array of documents associated with this history item
44
+ */
45
+ documents?: HistoryDocument[];
25
46
  /**
26
47
  * Name of the user who performed the action
27
48
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.3.41",
3
+ "version": "0.3.42",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"