cat-documents-ng 0.3.27 → 0.3.29

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.
@@ -11,7 +11,7 @@ export declare class DocumentActionsComponent implements OnChanges {
11
11
  readonly SHARED: typeof SHARED;
12
12
  document?: any;
13
13
  documentId?: string;
14
- currentStatus?: typeof SHARED.STATUS_PENDING | typeof SHARED.STATUS_ACCEPTED | typeof SHARED.STATUS_REJECTED_LOWERCASE;
14
+ currentStatus?: string;
15
15
  isLoading?: boolean;
16
16
  isUploaded?: boolean;
17
17
  statusId?: string;
@@ -33,6 +33,21 @@ export declare class DocumentActionsComponent implements OnChanges {
33
33
  constructor(documentActionsService: DocumentActionsService, sessionService: SessionService, confirmationService: ConfirmationService);
34
34
  get rejectNote(): string;
35
35
  set rejectNote(value: string);
36
+ /**
37
+ * Checks if both action buttons should be disabled
38
+ * @returns {boolean} True if both buttons should be disabled
39
+ */
40
+ get areButtonsDisabled(): boolean;
41
+ /**
42
+ * Checks if the document is approved (case-insensitive)
43
+ * @returns {boolean} True if document is approved
44
+ */
45
+ get isDocumentApproved(): boolean;
46
+ /**
47
+ * Checks if the document is rejected (case-insensitive)
48
+ * @returns {boolean} True if document is rejected
49
+ */
50
+ get isDocumentRejected(): boolean;
36
51
  ngOnChanges(changes: SimpleChanges): void;
37
52
  /**
38
53
  * Updates computed properties based on currentStatus and statusId
@@ -21,7 +21,6 @@ export declare class DocumentContainerComponent implements OnInit, OnDestroy, On
21
21
  private documentQuery;
22
22
  private documentStore;
23
23
  private documentMenuService;
24
- refreshTrigger: any;
25
24
  /**
26
25
  * The document list response data
27
26
  * @type {DocumentListResponse[] | null}
@@ -153,5 +152,5 @@ export declare class DocumentContainerComponent implements OnInit, OnDestroy, On
153
152
  */
154
153
  ngOnDestroy(): void;
155
154
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContainerComponent, never>;
156
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContainerComponent, "lib-document-container", never, { "refreshTrigger": { "alias": "refreshTrigger"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, { "selectedDocument": "selectedDocument"; }, never, ["*"], false, never>;
155
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContainerComponent, "lib-document-container", never, { "contextId": { "alias": "contextId"; "required": false; }; }, { "selectedDocument": "selectedDocument"; }, never, ["*"], false, never>;
157
156
  }
@@ -154,7 +154,7 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
154
154
  */
155
155
  disallowedCharsRegex: RegExp;
156
156
  /**
157
- * Getter to format category labels with proper suffix
157
+ * Getter to return category labels as they come from the API
158
158
  */
159
159
  get formattedCategoryLabels(): string[];
160
160
  /**
@@ -219,6 +219,11 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
219
219
  * @param {boolean} isDeleteAction - Optional flag indicating if this refresh is due to a delete action
220
220
  */
221
221
  refreshDocumentList(isDeleteAction?: boolean): void;
222
+ /**
223
+ * Handles the event when the document viewer is destroyed
224
+ * Triggers a refresh of the document data
225
+ */
226
+ handleViewerDestroyed(): void;
222
227
  /**
223
228
  * Scrolls to the category section that matches the selected menu item
224
229
  * @param menuItemId - The ID of the selected menu item
@@ -6,6 +6,7 @@ import { DocumentListItem } from '../../models/document-list-response.model';
6
6
  import { DocumentAction } from '../../services/document-actions.service';
7
7
  import { MessageService } from 'primeng/api';
8
8
  import { DocumentViewerService, DocumentViewerState } from '../../services/document-viewer.service';
9
+ import { DocumentStore } from '../../state/document.store';
9
10
  import * as i0 from "@angular/core";
10
11
  /**
11
12
  * Component for viewing and managing document details.
@@ -17,6 +18,7 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
17
18
  private documentService;
18
19
  private messageService;
19
20
  private documentViewerService;
21
+ documentStore: DocumentStore;
20
22
  /**
21
23
  * Get the selected document by user.
22
24
  * @type {*}
@@ -39,6 +41,11 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
39
41
  documentStatusUpdated: EventEmitter<{
40
42
  actionType?: string;
41
43
  }>;
44
+ /**
45
+ * Event emitted when the document viewer is destroyed to trigger refresh
46
+ * @type {EventEmitter<void>}
47
+ */
48
+ viewerDestroyed: EventEmitter<void>;
42
49
  /**
43
50
  * Indicates whether a checkbox is selected.
44
51
  * @type {boolean}
@@ -76,7 +83,7 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
76
83
  * @param {DocumentService} documentService - Handle the states.
77
84
  * @param {DocumentViewerService} documentViewerService - Handle the viewer business logic.
78
85
  */
79
- constructor(documentHttpService: DocumentHttpService, documentService: DocumentHelperService, messageService: MessageService, documentViewerService: DocumentViewerService);
86
+ constructor(documentHttpService: DocumentHttpService, documentService: DocumentHelperService, messageService: MessageService, documentViewerService: DocumentViewerService, documentStore: DocumentStore);
80
87
  /**
81
88
  * Fetches the alerts for the selected document.
82
89
  * @returns {void}
@@ -93,6 +100,10 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
93
100
  */
94
101
  handleDocumentAction(action: DocumentAction): void;
95
102
  ngOnDestroy(): void;
103
+ /**
104
+ * Refreshes document data when the viewer is closed
105
+ */
106
+ private refreshDocumentData;
96
107
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentViewerComponent, never>;
97
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentViewerComponent, "document-viewer", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, { "documentStatusUpdated": "documentStatusUpdated"; }, never, ["*"], false, never>;
108
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentViewerComponent, "document-viewer", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, { "documentStatusUpdated": "documentStatusUpdated"; "viewerDestroyed": "viewerDestroyed"; }, never, ["*"], false, never>;
98
109
  }
@@ -36,6 +36,12 @@ export declare class DocumentHistoryService {
36
36
  * @param docName - The name of the document
37
37
  */
38
38
  downloadDocument(documentUrl: string, docName?: string): void;
39
+ /**
40
+ * Alternative download method for CORS issues
41
+ * @param documentUrl - The URL of the document to download
42
+ * @param docName - The name of the document
43
+ */
44
+ private downloadWithAlternativeMethod;
39
45
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryService, never>;
40
46
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHistoryService>;
41
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.3.27",
3
+ "version": "0.3.29",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"