cat-documents-ng 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +298 -35
- package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +44 -0
- package/Shared/components/table-primary/table-primary.component.d.ts +31 -0
- package/Shared/components/table-primary/table-primary.model.d.ts +19 -0
- package/Shared/constant/ERROR.d.ts +52 -0
- package/Shared/constant/SHARED.d.ts +546 -0
- package/Shared/constant/URLS.d.ts +123 -0
- package/Shared/services/app-config.service.d.ts +51 -0
- package/{projects/cat-document-lib/src/shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +9 -11
- package/Shared/services/session.service.d.ts +46 -0
- package/Shared/shared.module.d.ts +14 -0
- package/fesm2022/cat-documents-ng.mjs +11392 -0
- package/fesm2022/cat-documents-ng.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/document/components/document-actions/document-actions.component.d.ts +78 -0
- package/lib/document/components/document-container/document-container.component.d.ts +162 -0
- package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +291 -0
- package/lib/document/components/document-history/document-history.component.d.ts +160 -0
- package/lib/document/components/document-list/document-list.component.d.ts +299 -0
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
- package/lib/document/components/document-search/document-search.component.d.ts +77 -0
- package/lib/document/components/document-status/document-status.component.d.ts +24 -0
- package/lib/document/components/document-upload/document-upload.component.d.ts +321 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +137 -0
- package/lib/document/components/document-zoom-controls/document-zoom-controls.component.d.ts +33 -0
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +110 -0
- package/{projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +12 -26
- package/lib/document/components/folder-container/folder-container.component.d.ts +162 -0
- package/lib/document/components/linked-document/linked-document.component.d.ts +39 -0
- package/lib/document/components/request-document/request-document.component.d.ts +69 -0
- package/lib/document/components/sidebar/sidebar.component.d.ts +109 -0
- package/lib/document/components/user-list/user-list.component.d.ts +34 -0
- package/lib/document/constant/DOCUMENT_HISTORY.d.ts +41 -0
- package/lib/document/directives/document.directive.d.ts +20 -0
- package/lib/document/directives/permission.directive.d.ts +38 -0
- package/lib/document/document.module.d.ts +60 -0
- package/lib/document/models/document-alert.model.d.ts +38 -0
- package/lib/document/models/document-category.model.d.ts +24 -0
- package/lib/document/models/document-history.model.d.ts +94 -0
- package/lib/document/models/document-list-response.model.d.ts +33 -0
- package/lib/document/models/document-type.model.d.ts +37 -0
- package/lib/document/models/document.model.d.ts +44 -0
- package/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +7 -13
- package/lib/document/models/status-data.model.d.ts +27 -0
- package/lib/document/models/uploaded-file-response.model.d.ts +7 -0
- package/lib/document/models/user-list.model.d.ts +8 -0
- package/lib/document/services/csv-parser.service.d.ts +88 -0
- package/lib/document/services/document-actions.service.d.ts +48 -0
- package/lib/document/services/document-content-type.service.d.ts +85 -0
- package/lib/document/services/document-history-style.service.d.ts +34 -0
- package/lib/document/services/document-history.service.d.ts +42 -0
- package/lib/document/services/document-http.service.d.ts +179 -0
- package/lib/document/services/document-list.service.d.ts +74 -0
- package/lib/document/services/document-menu.service.d.ts +122 -0
- package/lib/document/services/document-scroll.service.d.ts +55 -0
- package/lib/document/services/document-table-builder.service.d.ts +38 -0
- package/lib/document/services/document-upload-business.service.d.ts +107 -0
- package/lib/document/services/document-upload-data.service.d.ts +40 -0
- package/lib/document/services/document-upload-form.service.d.ts +41 -0
- package/lib/document/services/document-upload.service.d.ts +99 -0
- package/lib/document/services/document-viewer.service.d.ts +97 -0
- package/lib/document/services/document-zoom.service.d.ts +81 -0
- package/lib/document/services/document.service.d.ts +161 -0
- package/lib/document/services/eml-parser.service.d.ts +116 -0
- package/lib/document/services/excel-parser.service.d.ts +169 -0
- package/lib/document/services/file-format.service.d.ts +34 -0
- package/lib/document/services/status-calculator.service.d.ts +20 -0
- package/lib/document/services/user-list.service.d.ts +29 -0
- package/lib/document/state/document.query.d.ts +243 -0
- package/{projects/cat-document-lib/src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +15 -46
- package/lib/document/state/document.state.d.ts +61 -0
- package/lib/document/state/document.store.d.ts +56 -0
- package/package.json +19 -57
- package/public-api.d.ts +27 -0
- package/src/assets/images/Document interface.png +0 -0
- package/src/assets/images/Document upload.png +0 -0
- package/src/assets/images/Pdf viewer dialog.png +0 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
- package/.husky/pre-commit +0 -4
- package/angular.json +0 -119
- package/eslint.config.cjs +0 -148
- package/projects/cat-document-lib/README.md +0 -63
- package/projects/cat-document-lib/ng-package.json +0 -11
- package/projects/cat-document-lib/package.json +0 -16
- package/projects/cat-document-lib/setup-jest.ts +0 -1
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
- package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -187
- package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
- package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
- package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
- package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
- package/projects/cat-document-lib/src/lib/document/state/document.state.ts +0 -39
- package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
- package/projects/cat-document-lib/src/public-api.ts +0 -8
- package/projects/cat-document-lib/src/shared/constant/SHARED.ts +0 -232
- package/projects/cat-document-lib/src/shared/constant/URLS.ts +0 -31
- package/projects/cat-document-lib/src/shared/services/app-config.service.spec.ts +0 -16
- package/projects/cat-document-lib/src/shared/services/app-config.service.ts +0 -73
- package/projects/cat-document-lib/tsconfig.lib.json +0 -15
- package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
- package/projects/cat-document-lib/tsconfig.spec.json +0 -15
- package/public/favicon.ico +0 -0
- package/src/app/app.component.html +0 -1
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts +0 -29
- package/src/app/app.component.ts +0 -15
- package/src/app/app.module.ts +0 -60
- package/src/app/app.routing.module.ts +0 -19
- package/src/index.html +0 -13
- package/src/main.ts +0 -5
- package/src/styles.scss +0 -39
- package/tsconfig.app.json +0 -15
- package/tsconfig.json +0 -32
- /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
- /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
- /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { SHARED } from '../../../../Shared/constant/SHARED';
|
|
3
|
+
import { DocumentActionsService, DocumentAction } from '../../services/document-actions.service';
|
|
4
|
+
import { SessionService } from '../../../../Shared/services/session.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DocumentActionsComponent implements OnChanges {
|
|
7
|
+
private documentActionsService;
|
|
8
|
+
private sessionService;
|
|
9
|
+
readonly SHARED: typeof SHARED;
|
|
10
|
+
document?: any;
|
|
11
|
+
documentId?: string;
|
|
12
|
+
currentStatus?: string;
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
isUploaded?: boolean;
|
|
15
|
+
statusId?: string;
|
|
16
|
+
actionPerformed: EventEmitter<DocumentAction>;
|
|
17
|
+
showAcceptDialog: boolean;
|
|
18
|
+
showRejectDialog: boolean;
|
|
19
|
+
acceptNote: string;
|
|
20
|
+
private _rejectNote;
|
|
21
|
+
userRole: any;
|
|
22
|
+
isAccepting: boolean;
|
|
23
|
+
isRejecting: boolean;
|
|
24
|
+
cardClass: string;
|
|
25
|
+
rejectButtonClass: string;
|
|
26
|
+
acceptButtonClass: string;
|
|
27
|
+
isRejectNoteEmpty: boolean;
|
|
28
|
+
showApproveRejectActions: boolean;
|
|
29
|
+
showNoActions: boolean;
|
|
30
|
+
constructor(documentActionsService: DocumentActionsService, sessionService: SessionService);
|
|
31
|
+
get rejectNote(): string;
|
|
32
|
+
set rejectNote(value: string);
|
|
33
|
+
/**
|
|
34
|
+
* Checks if both action buttons should be disabled
|
|
35
|
+
* @returns {boolean} True if both buttons should be disabled
|
|
36
|
+
*/
|
|
37
|
+
get areButtonsDisabled(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Checks if the document is approved (case-insensitive)
|
|
40
|
+
* @returns {boolean} True if document is approved
|
|
41
|
+
*/
|
|
42
|
+
get isDocumentApproved(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if the document is rejected (case-insensitive)
|
|
45
|
+
* @returns {boolean} True if document is rejected
|
|
46
|
+
*/
|
|
47
|
+
get isDocumentRejected(): boolean;
|
|
48
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
49
|
+
/**
|
|
50
|
+
* Updates computed properties based on currentStatus and statusId
|
|
51
|
+
*/
|
|
52
|
+
private updateComputedProperties;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if the current user is a Team Leader
|
|
55
|
+
* @returns {boolean} True if user is Team Leader
|
|
56
|
+
*/
|
|
57
|
+
isUserTeamLeader(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if the current user is an Underwriter
|
|
60
|
+
* @returns {boolean} True if user is Underwriter
|
|
61
|
+
*/
|
|
62
|
+
isUserUnderwriter(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Updates the isRejectNoteEmpty property based on current rejectNote value
|
|
65
|
+
*/
|
|
66
|
+
updateRejectNoteEmpty(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Resets the action processing flags
|
|
69
|
+
*/
|
|
70
|
+
private resetActionFlags;
|
|
71
|
+
onAcceptClick(): void;
|
|
72
|
+
onRejectClick(): void;
|
|
73
|
+
onAcceptConfirm(): void;
|
|
74
|
+
onRejectConfirm(): void;
|
|
75
|
+
onCancel(): void;
|
|
76
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentActionsComponent, never>;
|
|
77
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentActionsComponent, "document-actions", never, { "document": { "alias": "document"; "required": false; }; "documentId": { "alias": "documentId"; "required": false; }; "currentStatus": { "alias": "currentStatus"; "required": false; }; "isLoading": { "alias": "isLoading"; "required": false; }; "isUploaded": { "alias": "isUploaded"; "required": false; }; "statusId": { "alias": "statusId"; "required": false; }; }, { "actionPerformed": "actionPerformed"; }, never, never, false, never>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { OnInit, OnDestroy, OnChanges, SimpleChanges, ElementRef, EventEmitter } from '@angular/core';
|
|
2
|
+
import { Subscription } from 'rxjs';
|
|
3
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
4
|
+
import { DocumentQuery } from '../../state/document.query';
|
|
5
|
+
import { DocumentStore } from '../../state/document.store';
|
|
6
|
+
import { DocumentCategory } from '../../models/document-category.model';
|
|
7
|
+
import { UserListModel } from '../../models/user-list.model';
|
|
8
|
+
import { StatusDataModel } from '../../models/status-data.model';
|
|
9
|
+
import { DocumentListResponse } from '../../models/document-list-response.model';
|
|
10
|
+
import { DocumentHelperService } from '../../services/document.service';
|
|
11
|
+
import { DocumentMenuService } from '../../services/document-menu.service';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
/**
|
|
14
|
+
*This component is responsible for managing and displaying a list of documents.
|
|
15
|
+
* @class DocumentContainerComponent
|
|
16
|
+
* @typedef {DocumentContainerComponent}
|
|
17
|
+
*/
|
|
18
|
+
export declare class DocumentContainerComponent implements OnInit, OnDestroy, OnChanges {
|
|
19
|
+
private documentHttpService;
|
|
20
|
+
private documentHelperService;
|
|
21
|
+
private documentQuery;
|
|
22
|
+
private documentStore;
|
|
23
|
+
private documentMenuService;
|
|
24
|
+
/**
|
|
25
|
+
* The document list response data
|
|
26
|
+
* @type {DocumentListResponse[] | null}
|
|
27
|
+
*/
|
|
28
|
+
documentListResponse: DocumentListResponse[] | null;
|
|
29
|
+
/**
|
|
30
|
+
* Status data for the current selection
|
|
31
|
+
* @type {StatusDataModel[]}
|
|
32
|
+
*/
|
|
33
|
+
statusData: StatusDataModel[];
|
|
34
|
+
/**
|
|
35
|
+
* The currently selected menu item ID for scrolling
|
|
36
|
+
*/
|
|
37
|
+
selectedMenuItemId: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Additional navigation information for better scrolling
|
|
40
|
+
*/
|
|
41
|
+
navigationInfo: {
|
|
42
|
+
menuItemId: string;
|
|
43
|
+
menuItemLabel: string;
|
|
44
|
+
categoryLabel: string;
|
|
45
|
+
categoryIndex: number;
|
|
46
|
+
} | null;
|
|
47
|
+
/**
|
|
48
|
+
* Reference to the content scroll container
|
|
49
|
+
*/
|
|
50
|
+
contentScrollContainer: ElementRef;
|
|
51
|
+
selectedDocument: EventEmitter<any>;
|
|
52
|
+
selectedDocumentInNewTab: EventEmitter<any>;
|
|
53
|
+
/**
|
|
54
|
+
* Subscription to track selected menu item changes
|
|
55
|
+
*/
|
|
56
|
+
private selectedMenuItemSubscription;
|
|
57
|
+
/**
|
|
58
|
+
* Creates an instance of DocumentContainerComponent.
|
|
59
|
+
* @param {DocumentHttpService} documentHttpService - Service for HTTP operations
|
|
60
|
+
* @param {DocumentHelperService} documentHelperService - Service for document operations
|
|
61
|
+
* @param {DocumentQuery} documentQuery - Query service for document state
|
|
62
|
+
* @param {DocumentStore} documentStore - Store service for document state
|
|
63
|
+
* @param {DocumentMenuService} documentMenuService - Service for menu operations
|
|
64
|
+
*/
|
|
65
|
+
constructor(documentHttpService: DocumentHttpService, documentHelperService: DocumentHelperService, documentQuery: DocumentQuery, documentStore: DocumentStore, documentMenuService: DocumentMenuService);
|
|
66
|
+
/**
|
|
67
|
+
* Get contextId in input.
|
|
68
|
+
* @type {string}
|
|
69
|
+
*/
|
|
70
|
+
contextId: string;
|
|
71
|
+
/**
|
|
72
|
+
* The list of folders.
|
|
73
|
+
* @type {Array}
|
|
74
|
+
*/
|
|
75
|
+
applicationNumber: string;
|
|
76
|
+
catagories: DocumentCategory[];
|
|
77
|
+
userList: UserListModel[];
|
|
78
|
+
/**
|
|
79
|
+
* Holds the subscription to manage observable cleanup.
|
|
80
|
+
* @type {Subscription}
|
|
81
|
+
*/
|
|
82
|
+
subscription: Subscription;
|
|
83
|
+
/**
|
|
84
|
+
* Handles changes to input properties
|
|
85
|
+
*/
|
|
86
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
87
|
+
/**
|
|
88
|
+
* Initializes the component
|
|
89
|
+
*/
|
|
90
|
+
ngOnInit(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Sets up subscription to track selected menu item changes
|
|
93
|
+
*/
|
|
94
|
+
setupSelectedMenuItemSubscription(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Handles menu item selection events from the documents menu
|
|
97
|
+
* @param event - The menu item selection event
|
|
98
|
+
*/
|
|
99
|
+
onMenuItemSelected(event: {
|
|
100
|
+
item: any;
|
|
101
|
+
category: any;
|
|
102
|
+
navigationInfo?: {
|
|
103
|
+
menuItemId: string;
|
|
104
|
+
menuItemLabel: string;
|
|
105
|
+
categoryLabel: string;
|
|
106
|
+
categoryIndex: number;
|
|
107
|
+
};
|
|
108
|
+
}): void;
|
|
109
|
+
/**
|
|
110
|
+
* Resets the content scroll container to the top
|
|
111
|
+
*/
|
|
112
|
+
private resetContentScrollToTop;
|
|
113
|
+
/**
|
|
114
|
+
* Initialize all data with proper sequencing to avoid duplicate API calls
|
|
115
|
+
*/
|
|
116
|
+
initializeData(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Clears all state (store and component) comprehensively
|
|
119
|
+
*/
|
|
120
|
+
clearAllState(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Handles contextId change by clearing all state and refetching data
|
|
123
|
+
*/
|
|
124
|
+
handleContextIdChange(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Sets up subscriptions to monitor menu item and user selection changes
|
|
127
|
+
* to trigger status data fetching and user list refreshing
|
|
128
|
+
*/
|
|
129
|
+
setupStatusDataSubscriptions(): void;
|
|
130
|
+
onDocumentSelectedInNewTab(event: {
|
|
131
|
+
selectedDocument: any;
|
|
132
|
+
contextId: string;
|
|
133
|
+
documentList: any[];
|
|
134
|
+
}): void;
|
|
135
|
+
/**
|
|
136
|
+
* Fetches status data based on current selections
|
|
137
|
+
*/
|
|
138
|
+
fetchStatusData(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Fetches userlist data with current filters applied
|
|
141
|
+
*/
|
|
142
|
+
fetchUserListWithFilters(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Fetches document catagory data.
|
|
145
|
+
*/
|
|
146
|
+
fetchDocumentCatagories(): void;
|
|
147
|
+
/**
|
|
148
|
+
* Refetches all data when contextId changes
|
|
149
|
+
*/
|
|
150
|
+
refetchAllDataForNewContext(): void;
|
|
151
|
+
/**
|
|
152
|
+
* Sets up subscription to listen for filtered document responses
|
|
153
|
+
*/
|
|
154
|
+
setupFilteredDocumentSubscription(): void;
|
|
155
|
+
onDocumentSelected(document: any): void;
|
|
156
|
+
/**
|
|
157
|
+
* Unsubscribe subscription on destroy of component and clean up state.
|
|
158
|
+
*/
|
|
159
|
+
ngOnDestroy(): void;
|
|
160
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContainerComponent, never>;
|
|
161
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContainerComponent, "lib-document-container", never, { "contextId": { "alias": "contextId"; "required": false; }; }, { "selectedDocument": "selectedDocument"; "selectedDocumentInNewTab": "selectedDocumentInNewTab"; }, never, ["*"], false, never>;
|
|
162
|
+
}
|
package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges, OnInit } from '@angular/core';
|
|
2
|
+
import { ExcelParserService, ExcelRowData } from '../../services/excel-parser.service';
|
|
3
|
+
import { CsvParserService, CsvRowData } from '../../services/csv-parser.service';
|
|
4
|
+
import { EmlParserService, ParsedEmailData } from '../../services/eml-parser.service';
|
|
5
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
6
|
+
import { DocumentZoomService } from '../../services/document-zoom.service';
|
|
7
|
+
import { DocumentListItem } from '../../models/document-list-response.model';
|
|
8
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* Component for viewing different types of document content.
|
|
12
|
+
* Supports PDF, images, and other document formats.
|
|
13
|
+
* @class DocumentContentViewerComponent
|
|
14
|
+
* @typedef {DocumentContentViewerComponent}
|
|
15
|
+
*/
|
|
16
|
+
export declare class DocumentContentViewerComponent implements OnChanges, OnInit {
|
|
17
|
+
private excelParserService;
|
|
18
|
+
private csvParserService;
|
|
19
|
+
private emlParserService;
|
|
20
|
+
private documentHttpService;
|
|
21
|
+
private zoomService;
|
|
22
|
+
private sanitizer;
|
|
23
|
+
/**
|
|
24
|
+
* The document URL to display
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
27
|
+
documentUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The content type of the document
|
|
30
|
+
* @type {string}
|
|
31
|
+
*/
|
|
32
|
+
contentType?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The document name for display purposes
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
documentName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The selected document for display purposes
|
|
40
|
+
* @type {DocumentListItem}
|
|
41
|
+
*/
|
|
42
|
+
selectedDocument?: DocumentListItem;
|
|
43
|
+
/**
|
|
44
|
+
* The context ID for the document
|
|
45
|
+
* @type {string}
|
|
46
|
+
*/
|
|
47
|
+
contextId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Flag to hide form elements
|
|
50
|
+
* @type {boolean}
|
|
51
|
+
*/
|
|
52
|
+
isFormHide: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Excel data for display
|
|
55
|
+
* @type {any}
|
|
56
|
+
*/
|
|
57
|
+
excelData: any;
|
|
58
|
+
/**
|
|
59
|
+
* Parsed Excel data as table rows
|
|
60
|
+
* @type {any[][]}
|
|
61
|
+
*/
|
|
62
|
+
excelTableData: any[][];
|
|
63
|
+
/**
|
|
64
|
+
* Enhanced Excel data with styling information
|
|
65
|
+
* @type {ExcelRowData[]}
|
|
66
|
+
*/
|
|
67
|
+
excelStyledData: ExcelRowData[];
|
|
68
|
+
/**
|
|
69
|
+
* Excel sheet names
|
|
70
|
+
* @type {string[]}
|
|
71
|
+
*/
|
|
72
|
+
excelSheets: string[];
|
|
73
|
+
/**
|
|
74
|
+
* Current active sheet
|
|
75
|
+
* @type {string}
|
|
76
|
+
*/
|
|
77
|
+
currentSheet: string;
|
|
78
|
+
/**
|
|
79
|
+
* Loading state for Excel files
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
*/
|
|
82
|
+
isLoadingExcel: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Error state for Excel files
|
|
85
|
+
* @type {string | null}
|
|
86
|
+
*/
|
|
87
|
+
excelError: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* Loading state specifically for Word documents
|
|
90
|
+
* @type {boolean}
|
|
91
|
+
*/
|
|
92
|
+
isLoadingWordDocument: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* CSV data for display
|
|
95
|
+
* @type {any}
|
|
96
|
+
*/
|
|
97
|
+
csvData: any;
|
|
98
|
+
/**
|
|
99
|
+
* Parsed CSV data as table rows
|
|
100
|
+
* @type {any[][]}
|
|
101
|
+
*/
|
|
102
|
+
csvTableData: any[][];
|
|
103
|
+
/**
|
|
104
|
+
* Enhanced CSV data with styling information
|
|
105
|
+
* @type {CsvRowData[]}
|
|
106
|
+
*/
|
|
107
|
+
csvStyledData: CsvRowData[];
|
|
108
|
+
/**
|
|
109
|
+
* Loading state for CSV files
|
|
110
|
+
* @type {boolean}
|
|
111
|
+
*/
|
|
112
|
+
isLoadingCsv: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Error state for CSV files
|
|
115
|
+
* @type {string | null}
|
|
116
|
+
*/
|
|
117
|
+
csvError: string | null;
|
|
118
|
+
/**
|
|
119
|
+
* Current zoom level for the document
|
|
120
|
+
* @type {number}
|
|
121
|
+
*/
|
|
122
|
+
currentZoom: number;
|
|
123
|
+
/**
|
|
124
|
+
* Email data for display
|
|
125
|
+
* @type {ParsedEmailData | null}
|
|
126
|
+
*/
|
|
127
|
+
emailData: ParsedEmailData | null;
|
|
128
|
+
/**
|
|
129
|
+
* Loading state for Email files
|
|
130
|
+
* @type {boolean}
|
|
131
|
+
*/
|
|
132
|
+
isLoadingEmail: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Error state for Email files
|
|
135
|
+
* @type {string | null}
|
|
136
|
+
*/
|
|
137
|
+
emailError: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Constructor
|
|
140
|
+
* @param {ExcelParserService} excelParserService - Service for parsing Excel files
|
|
141
|
+
* @param {CsvParserService} csvParserService - Service for parsing CSV files
|
|
142
|
+
* @param {EmlParserService} emlParserService - Service for parsing EML files
|
|
143
|
+
* @param {DocumentHttpService} documentHttpService - Service for making HTTP requests for Excel/CSV files
|
|
144
|
+
* @param {DocumentZoomService} zoomService - Service for handling zoom functionality
|
|
145
|
+
* @param {DomSanitizer} sanitizer - Service for sanitizing HTML content
|
|
146
|
+
*/
|
|
147
|
+
constructor(excelParserService: ExcelParserService, csvParserService: CsvParserService, emlParserService: EmlParserService, documentHttpService: DocumentHttpService, zoomService: DocumentZoomService, sanitizer: DomSanitizer);
|
|
148
|
+
/**
|
|
149
|
+
* Computed property to determine if the document is a PDF
|
|
150
|
+
* @type {boolean}
|
|
151
|
+
*/
|
|
152
|
+
get isPdf(): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Computed property to determine if the document is an Excel file
|
|
155
|
+
* @type {boolean}
|
|
156
|
+
*/
|
|
157
|
+
get isExcel(): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Computed property to determine if the document is a Word file
|
|
160
|
+
* @type {boolean}
|
|
161
|
+
*/
|
|
162
|
+
get isWord(): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Computed property to determine if the document is a CSV file
|
|
165
|
+
* @type {boolean}
|
|
166
|
+
*/
|
|
167
|
+
get isCsv(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Computed property to determine if the document is an email file
|
|
170
|
+
* @type {boolean}
|
|
171
|
+
*/
|
|
172
|
+
get isEmail(): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Computed property to determine if the document is an OpenDocument file
|
|
175
|
+
* @type {boolean}
|
|
176
|
+
*/
|
|
177
|
+
get isOpenDocument(): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Computed property to determine if the document has an unsupported content type
|
|
180
|
+
* @type {boolean}
|
|
181
|
+
*/
|
|
182
|
+
get isUnsupported(): boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Computed property to get the appropriate icon for the document type
|
|
185
|
+
* @type {string}
|
|
186
|
+
*/
|
|
187
|
+
get documentIcon(): string;
|
|
188
|
+
/**
|
|
189
|
+
* Computed property to get the display text for the document type
|
|
190
|
+
* @type {string}
|
|
191
|
+
*/
|
|
192
|
+
get documentTypeText(): string;
|
|
193
|
+
/**
|
|
194
|
+
* Safely gets the styled Excel data for display
|
|
195
|
+
* @type {ExcelRowData[]}
|
|
196
|
+
*/
|
|
197
|
+
get safeExcelStyledData(): ExcelRowData[];
|
|
198
|
+
/**
|
|
199
|
+
* Safely gets the styled CSV data for display
|
|
200
|
+
* @type {CsvRowData[]}
|
|
201
|
+
*/
|
|
202
|
+
get safeCsvStyledData(): CsvRowData[];
|
|
203
|
+
/**
|
|
204
|
+
* Handles changes to input properties
|
|
205
|
+
* @param {SimpleChanges} changes - The changes object
|
|
206
|
+
*/
|
|
207
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
208
|
+
/**
|
|
209
|
+
* Initializes the component
|
|
210
|
+
*/
|
|
211
|
+
ngOnInit(): void;
|
|
212
|
+
/**
|
|
213
|
+
* Initializes zoom functionality
|
|
214
|
+
*/
|
|
215
|
+
private initializeZoom;
|
|
216
|
+
/**
|
|
217
|
+
* Handles mouse wheel events for zooming
|
|
218
|
+
*/
|
|
219
|
+
onWheel(event: WheelEvent): void;
|
|
220
|
+
/**
|
|
221
|
+
* Handles wheel zoom for document viewers
|
|
222
|
+
*/
|
|
223
|
+
handleWheelZoom(event: WheelEvent): void;
|
|
224
|
+
/**
|
|
225
|
+
* Applies zoom transform to the document viewer
|
|
226
|
+
*/
|
|
227
|
+
private applyZoomTransform;
|
|
228
|
+
/**
|
|
229
|
+
* Downloads the document
|
|
230
|
+
*/
|
|
231
|
+
downloadDocument(): void;
|
|
232
|
+
/**
|
|
233
|
+
* Opens the document in a new tab
|
|
234
|
+
*/
|
|
235
|
+
openInNewTab(): void;
|
|
236
|
+
/**
|
|
237
|
+
* Loads Excel data for display
|
|
238
|
+
*/
|
|
239
|
+
private loadExcelData;
|
|
240
|
+
/**
|
|
241
|
+
* Parses Excel data using the service
|
|
242
|
+
* @param {ArrayBuffer} data - Excel file data
|
|
243
|
+
*/
|
|
244
|
+
private parseExcelData;
|
|
245
|
+
/**
|
|
246
|
+
* Changes the active Excel sheet
|
|
247
|
+
* @param {string} sheetName - Name of the sheet to activate
|
|
248
|
+
*/
|
|
249
|
+
changeSheet(sheetName: string): void;
|
|
250
|
+
/**
|
|
251
|
+
* Resets Excel data to initial state
|
|
252
|
+
*/
|
|
253
|
+
private resetExcelData;
|
|
254
|
+
/**
|
|
255
|
+
* Loads CSV data for display
|
|
256
|
+
*/
|
|
257
|
+
private loadCsvData;
|
|
258
|
+
/**
|
|
259
|
+
* Parses CSV data using the service
|
|
260
|
+
* @param {string} data - CSV file data
|
|
261
|
+
*/
|
|
262
|
+
private parseCsvData;
|
|
263
|
+
/**
|
|
264
|
+
* Resets CSV data to initial state
|
|
265
|
+
*/
|
|
266
|
+
private resetCsvData;
|
|
267
|
+
/**
|
|
268
|
+
* TrackBy function for CSV cells to improve performance
|
|
269
|
+
* @param index - Cell index
|
|
270
|
+
* @param cell - Cell object
|
|
271
|
+
* @returns Unique identifier for the cell
|
|
272
|
+
*/
|
|
273
|
+
trackByCell(index: number, cell: any): any;
|
|
274
|
+
/**
|
|
275
|
+
* Checks if CSV data is valid and ready for display
|
|
276
|
+
* @returns {boolean} True if CSV data is valid
|
|
277
|
+
*/
|
|
278
|
+
private isCsvDataValid;
|
|
279
|
+
private getFileExtension;
|
|
280
|
+
get isImage(): boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Loads Email data for display
|
|
283
|
+
*/
|
|
284
|
+
private loadEmailData;
|
|
285
|
+
/**
|
|
286
|
+
* Resets Email data to initial state
|
|
287
|
+
*/
|
|
288
|
+
private resetEmailData;
|
|
289
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentContentViewerComponent, never>;
|
|
290
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentContentViewerComponent, "document-content-viewer", never, { "documentUrl": { "alias": "documentUrl"; "required": false; }; "contentType": { "alias": "contentType"; "required": false; }; "documentName": { "alias": "documentName"; "required": false; }; "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; "isFormHide": { "alias": "isFormHide"; "required": false; }; }, {}, never, never, false, never>;
|
|
291
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { DocumentHistorySection, HistoryDocument } from '../../models/document-history.model';
|
|
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';
|
|
7
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Component for displaying document history in a timeline format.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DocumentHistoryComponent implements OnChanges {
|
|
13
|
+
private documentHistoryService;
|
|
14
|
+
private documentViewerService;
|
|
15
|
+
private documentActionsService;
|
|
16
|
+
private confirmationService;
|
|
17
|
+
private documentHttpService;
|
|
18
|
+
/**
|
|
19
|
+
* Input data for document history sections
|
|
20
|
+
*/
|
|
21
|
+
historyData: DocumentHistorySection[];
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show the history component
|
|
24
|
+
*/
|
|
25
|
+
showHistory: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The context ID for API calls
|
|
28
|
+
*/
|
|
29
|
+
contextId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The selected document for actions
|
|
32
|
+
*/
|
|
33
|
+
selectedDocument?: any;
|
|
34
|
+
/**
|
|
35
|
+
* Event emitted when delete task is requested
|
|
36
|
+
*/
|
|
37
|
+
deleteTaskRequested: EventEmitter<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Event emitted when a document from history is selected
|
|
40
|
+
*/
|
|
41
|
+
documentSelected: EventEmitter<HistoryDocument>;
|
|
42
|
+
/**
|
|
43
|
+
* Reference to the document actions component
|
|
44
|
+
*/
|
|
45
|
+
documentActionsComponent?: any;
|
|
46
|
+
/**
|
|
47
|
+
* Active accordion index for controlling expand/collapse
|
|
48
|
+
*/
|
|
49
|
+
activeAccordionIndex: number;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the accordion is expanded
|
|
52
|
+
*/
|
|
53
|
+
isAccordionExpanded: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the actions dropdown menu is visible
|
|
56
|
+
*/
|
|
57
|
+
showActionsMenu: boolean;
|
|
58
|
+
constructor(documentHistoryService: DocumentHistoryService, documentViewerService: DocumentViewerService, documentActionsService: DocumentActionsService, confirmationService: ConfirmationService, documentHttpService: DocumentHttpService);
|
|
59
|
+
/**
|
|
60
|
+
* Handles changes to input properties
|
|
61
|
+
*/
|
|
62
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
63
|
+
/**
|
|
64
|
+
* Handle accordion open event
|
|
65
|
+
*/
|
|
66
|
+
onAccordionOpen(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Handle accordion close event
|
|
69
|
+
*/
|
|
70
|
+
onAccordionClose(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Toggle accordion state
|
|
73
|
+
*/
|
|
74
|
+
toggleAccordion(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Process history data to add computed properties
|
|
77
|
+
*/
|
|
78
|
+
get processedHistoryData(): any[];
|
|
79
|
+
/**
|
|
80
|
+
* Downloads a document when clicked
|
|
81
|
+
* @param documentUrl - The URL of the document to download
|
|
82
|
+
* @param docName - The name of the document
|
|
83
|
+
*/
|
|
84
|
+
downloadDocument(documentUrl: string, docName?: string): void;
|
|
85
|
+
/**
|
|
86
|
+
* Get alert count for the alerts section
|
|
87
|
+
*/
|
|
88
|
+
getAlertCount(): number;
|
|
89
|
+
/**
|
|
90
|
+
* Get CSS class for event card based on action type
|
|
91
|
+
*/
|
|
92
|
+
getEventCardClass(label: string): string;
|
|
93
|
+
/**
|
|
94
|
+
* Get CSS class for event icon based on action type
|
|
95
|
+
*/
|
|
96
|
+
getEventIconClass(label: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* Get the appropriate icon for the event
|
|
99
|
+
* @param label - The event label
|
|
100
|
+
* @returns {string} The icon class
|
|
101
|
+
*/
|
|
102
|
+
getEventIcon(label: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Toggle the actions dropdown menu
|
|
105
|
+
*/
|
|
106
|
+
toggleActionsMenu(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Close the actions dropdown menu
|
|
109
|
+
*/
|
|
110
|
+
closeActionsMenu(): void;
|
|
111
|
+
/**
|
|
112
|
+
* Handle delete task action
|
|
113
|
+
*/
|
|
114
|
+
onDeleteTask(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Shows standard delete confirmation dialog
|
|
117
|
+
* @private
|
|
118
|
+
*/
|
|
119
|
+
private showStandardDeleteConfirmation;
|
|
120
|
+
/**
|
|
121
|
+
* Performs the actual delete operation
|
|
122
|
+
* @private
|
|
123
|
+
*/
|
|
124
|
+
private performDelete;
|
|
125
|
+
/**
|
|
126
|
+
* Set reference to document actions component
|
|
127
|
+
*/
|
|
128
|
+
setDocumentActionsComponent(component: any): void;
|
|
129
|
+
/**
|
|
130
|
+
* Handles document selection from history
|
|
131
|
+
* @param document - The selected document from history
|
|
132
|
+
*/
|
|
133
|
+
onDocumentClick(document: HistoryDocument): void;
|
|
134
|
+
/**
|
|
135
|
+
* Processed history data with document lists
|
|
136
|
+
*/
|
|
137
|
+
private _processedHistoryData;
|
|
138
|
+
/**
|
|
139
|
+
* Processes history data to include document lists for each item
|
|
140
|
+
*/
|
|
141
|
+
private processHistoryData;
|
|
142
|
+
/**
|
|
143
|
+
* Gets the list of valid documents for a history item
|
|
144
|
+
* @param item - The history item
|
|
145
|
+
* @returns Array of valid documents
|
|
146
|
+
*/
|
|
147
|
+
private getValidDocuments;
|
|
148
|
+
/**
|
|
149
|
+
* Determines if a timeline item should be hidden
|
|
150
|
+
* @param item - The history item
|
|
151
|
+
* @returns True if the item should be hidden
|
|
152
|
+
*/
|
|
153
|
+
private shouldHideItem;
|
|
154
|
+
/**
|
|
155
|
+
* Listen for clicks outside the dropdown to close it
|
|
156
|
+
*/
|
|
157
|
+
onDocumentClickOutside(event: Event): void;
|
|
158
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryComponent, never>;
|
|
159
|
+
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; }; }, { "deleteTaskRequested": "deleteTaskRequested"; "documentSelected": "documentSelected"; }, never, ["*", "[actions-component]"], false, never>;
|
|
160
|
+
}
|