cat-documents-ng 1.0.5 → 1.0.6
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 +322 -322
- package/ng-package.json +10 -0
- package/package.json +5 -11
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.html +3 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.scss +13 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.spec.ts +70 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.ts +133 -0
- package/src/Shared/components/table-primary/table-primary.component.html +66 -0
- package/src/Shared/components/table-primary/table-primary.component.scss +227 -0
- package/src/Shared/components/table-primary/table-primary.component.spec.ts +23 -0
- package/src/Shared/components/table-primary/table-primary.component.ts +143 -0
- package/src/Shared/components/table-primary/table-primary.model.ts +21 -0
- package/src/Shared/constant/ERROR.ts +55 -0
- package/src/Shared/constant/PERMISSIONS.ts +17 -0
- package/src/Shared/constant/SHARED.ts +936 -0
- package/{Shared/constant/URLS.d.ts → src/Shared/constant/URLS.ts} +31 -25
- package/src/Shared/services/app-config.service.spec.ts +19 -0
- package/src/Shared/services/app-config.service.ts +73 -0
- package/{Shared/services/global-error.handler.d.ts → src/Shared/services/global-error.handler.ts} +11 -9
- package/src/Shared/services/session.service.spec.ts +16 -0
- package/src/Shared/services/session.service.ts +76 -0
- package/src/Shared/shared.module.ts +25 -0
- package/src/lib/document/components/csv-viewer/csv-viewer.component.ts +1 -0
- package/src/lib/document/components/document-actions/document-actions.component.html +59 -0
- package/src/lib/document/components/document-actions/document-actions.component.scss +362 -0
- package/src/lib/document/components/document-actions/document-actions.component.spec.ts +297 -0
- package/src/lib/document/components/document-actions/document-actions.component.ts +163 -0
- package/src/lib/document/components/document-container/document-container.component.html +36 -0
- package/src/lib/document/components/document-container/document-container.component.scss +144 -0
- package/src/lib/document/components/document-container/document-container.component.spec.ts +110 -0
- package/src/lib/document/components/document-container/document-container.component.ts +363 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.html +332 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.scss +1877 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.spec.ts +258 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.ts +664 -0
- package/src/lib/document/components/document-history/document-history.component.html +96 -0
- package/src/lib/document/components/document-history/document-history.component.scss +392 -0
- package/src/lib/document/components/document-history/document-history.component.spec.ts +93 -0
- package/src/lib/document/components/document-history/document-history.component.ts +373 -0
- package/src/lib/document/components/document-list/document-list.component.html +46 -0
- package/src/lib/document/components/document-list/document-list.component.scss +513 -0
- package/src/lib/document/components/document-list/document-list.component.spec.ts +486 -0
- package/src/lib/document/components/document-list/document-list.component.ts +682 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.html +36 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.scss +34 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +75 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.ts +40 -0
- package/src/lib/document/components/document-search/document-search.component.html +64 -0
- package/src/lib/document/components/document-search/document-search.component.scss +206 -0
- package/src/lib/document/components/document-search/document-search.component.spec.ts +82 -0
- package/src/lib/document/components/document-search/document-search.component.ts +163 -0
- package/src/lib/document/components/document-status/document-status.component.html +31 -0
- package/src/lib/document/components/document-status/document-status.component.scss +192 -0
- package/src/lib/document/components/document-status/document-status.component.spec.ts +23 -0
- package/src/lib/document/components/document-status/document-status.component.ts +87 -0
- package/src/lib/document/components/document-upload/document-upload.component.html +160 -0
- package/src/lib/document/components/document-upload/document-upload.component.scss +235 -0
- package/src/lib/document/components/document-upload/document-upload.component.spec.ts +95 -0
- package/src/lib/document/components/document-upload/document-upload.component.ts +668 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.html +50 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.scss +187 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +79 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.ts +261 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.html +48 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.scss +320 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.spec.ts +59 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.ts +150 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.html +44 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.scss +363 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.spec.ts +23 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.ts +316 -0
- package/src/lib/document/components/folder-block/folder-block.component.html +46 -0
- package/src/lib/document/components/folder-block/folder-block.component.scss +9 -0
- package/src/lib/document/components/folder-block/folder-block.component.spec.ts +70 -0
- package/{lib/document/components/folder-block/folder-block.component.d.ts → src/lib/document/components/folder-block/folder-block.component.ts} +28 -12
- package/src/lib/document/components/folder-container/folder-container.component.html +56 -0
- package/src/lib/document/components/folder-container/folder-container.component.scss +20 -0
- package/src/lib/document/components/folder-container/folder-container.component.spec.ts +27 -0
- package/src/lib/document/components/folder-container/folder-container.component.ts +328 -0
- package/src/lib/document/components/linked-document/linked-document.component.html +23 -0
- package/src/lib/document/components/linked-document/linked-document.component.scss +10 -0
- package/src/lib/document/components/linked-document/linked-document.component.spec.ts +61 -0
- package/src/lib/document/components/linked-document/linked-document.component.ts +49 -0
- package/src/lib/document/components/request-document/request-document.component.html +86 -0
- package/src/lib/document/components/request-document/request-document.component.scss +16 -0
- package/src/lib/document/components/request-document/request-document.component.ts +278 -0
- package/src/lib/document/components/sidebar/sidebar.component.html +75 -0
- package/src/lib/document/components/sidebar/sidebar.component.scss +157 -0
- package/src/lib/document/components/sidebar/sidebar.component.spec.ts +114 -0
- package/src/lib/document/components/sidebar/sidebar.component.ts +223 -0
- package/src/lib/document/components/user-list/user-list.component.html +33 -0
- package/src/lib/document/components/user-list/user-list.component.scss +118 -0
- package/src/lib/document/components/user-list/user-list.component.spec.ts +23 -0
- package/src/lib/document/components/user-list/user-list.component.ts +181 -0
- package/src/lib/document/constant/DOCUMENT_HISTORY.ts +52 -0
- package/src/lib/document/directives/document.directive.ts +32 -0
- package/src/lib/document/directives/permission.directive.spec.ts +0 -0
- package/src/lib/document/directives/permission.directive.ts +72 -0
- package/src/lib/document/document.module.ts +351 -0
- package/{lib/document/models/document-alert.model.d.ts → src/lib/document/models/document-alert.model.ts} +11 -4
- package/src/lib/document/models/document-category.model.ts +30 -0
- package/src/lib/document/models/document-history.model.ts +109 -0
- package/src/lib/document/models/document-list-response.model.ts +37 -0
- package/src/lib/document/models/document-type.model.ts +44 -0
- package/src/lib/document/models/document.model.ts +53 -0
- package/{lib/document/models/folder.model.d.ts → src/lib/document/models/folder.model.ts} +10 -4
- package/src/lib/document/models/status-data.model.ts +31 -0
- package/src/lib/document/models/uploaded-file-response.model.ts +7 -0
- package/src/lib/document/models/user-list.model.ts +10 -0
- package/src/lib/document/services/csv-parser.service.spec.ts +97 -0
- package/src/lib/document/services/csv-parser.service.ts +303 -0
- package/src/lib/document/services/document-actions.service.ts +125 -0
- package/src/lib/document/services/document-content-type.service.ts +193 -0
- package/src/lib/document/services/document-history-style.service.ts +138 -0
- package/src/lib/document/services/document-history.service.ts +129 -0
- package/src/lib/document/services/document-http.service.spec.ts +119 -0
- package/src/lib/document/services/document-http.service.ts +497 -0
- package/src/lib/document/services/document-list.service.ts +195 -0
- package/src/lib/document/services/document-menu.service.ts +277 -0
- package/src/lib/document/services/document-scroll.service.ts +138 -0
- package/src/lib/document/services/document-severity.service.ts +98 -0
- package/src/lib/document/services/document-table-builder.service.ts +82 -0
- package/src/lib/document/services/document-upload-business.service.ts +326 -0
- package/src/lib/document/services/document-upload-data.service.ts +82 -0
- package/src/lib/document/services/document-upload-form.service.ts +149 -0
- package/src/lib/document/services/document-upload.service.spec.ts +99 -0
- package/src/lib/document/services/document-upload.service.ts +209 -0
- package/src/lib/document/services/document-viewer.service.ts +279 -0
- package/src/lib/document/services/document-zoom.service.spec.ts +56 -0
- package/src/lib/document/services/document-zoom.service.ts +164 -0
- package/src/lib/document/services/document.service.ts +356 -0
- package/src/lib/document/services/eml-parser.service.ts +444 -0
- package/src/lib/document/services/excel-parser.service.spec.ts +66 -0
- package/src/lib/document/services/excel-parser.service.ts +483 -0
- package/src/lib/document/services/file-format.service.spec.ts +16 -0
- package/src/lib/document/services/file-format.service.ts +63 -0
- package/src/lib/document/services/status-calculator.service.ts +44 -0
- package/src/lib/document/services/user-list.service.ts +77 -0
- package/src/lib/document/state/document.query.ts +378 -0
- package/{lib/document/state/document.service.d.ts → src/lib/document/state/document.service.ts} +46 -15
- package/src/lib/document/state/document.state.ts +100 -0
- package/src/lib/document/state/document.store.ts +200 -0
- package/{public-api.d.ts → src/public-api.ts} +4 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -44
- package/Shared/components/table-primary/table-primary.component.d.ts +0 -31
- package/Shared/components/table-primary/table-primary.model.d.ts +0 -19
- package/Shared/constant/ERROR.d.ts +0 -52
- package/Shared/constant/SHARED.d.ts +0 -546
- package/Shared/services/app-config.service.d.ts +0 -51
- package/Shared/services/session.service.d.ts +0 -46
- package/Shared/shared.module.d.ts +0 -14
- package/fesm2022/cat-documents-ng.mjs +0 -11392
- package/fesm2022/cat-documents-ng.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/document/components/document-actions/document-actions.component.d.ts +0 -78
- package/lib/document/components/document-container/document-container.component.d.ts +0 -162
- package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +0 -291
- package/lib/document/components/document-history/document-history.component.d.ts +0 -160
- package/lib/document/components/document-list/document-list.component.d.ts +0 -299
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +0 -28
- package/lib/document/components/document-search/document-search.component.d.ts +0 -77
- package/lib/document/components/document-status/document-status.component.d.ts +0 -24
- package/lib/document/components/document-upload/document-upload.component.d.ts +0 -321
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +0 -137
- package/lib/document/components/document-zoom-controls/document-zoom-controls.component.d.ts +0 -33
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +0 -110
- package/lib/document/components/folder-container/folder-container.component.d.ts +0 -162
- package/lib/document/components/linked-document/linked-document.component.d.ts +0 -39
- package/lib/document/components/request-document/request-document.component.d.ts +0 -69
- package/lib/document/components/sidebar/sidebar.component.d.ts +0 -109
- package/lib/document/components/user-list/user-list.component.d.ts +0 -34
- package/lib/document/constant/DOCUMENT_HISTORY.d.ts +0 -41
- package/lib/document/directives/document.directive.d.ts +0 -20
- package/lib/document/directives/permission.directive.d.ts +0 -38
- package/lib/document/document.module.d.ts +0 -60
- package/lib/document/models/document-category.model.d.ts +0 -24
- package/lib/document/models/document-history.model.d.ts +0 -94
- package/lib/document/models/document-list-response.model.d.ts +0 -33
- package/lib/document/models/document-type.model.d.ts +0 -37
- package/lib/document/models/document.model.d.ts +0 -44
- package/lib/document/models/status-data.model.d.ts +0 -27
- package/lib/document/models/uploaded-file-response.model.d.ts +0 -7
- package/lib/document/models/user-list.model.d.ts +0 -8
- package/lib/document/services/csv-parser.service.d.ts +0 -88
- package/lib/document/services/document-actions.service.d.ts +0 -48
- package/lib/document/services/document-content-type.service.d.ts +0 -85
- package/lib/document/services/document-history-style.service.d.ts +0 -34
- package/lib/document/services/document-history.service.d.ts +0 -42
- package/lib/document/services/document-http.service.d.ts +0 -179
- package/lib/document/services/document-list.service.d.ts +0 -74
- package/lib/document/services/document-menu.service.d.ts +0 -122
- package/lib/document/services/document-scroll.service.d.ts +0 -55
- package/lib/document/services/document-table-builder.service.d.ts +0 -38
- package/lib/document/services/document-upload-business.service.d.ts +0 -107
- package/lib/document/services/document-upload-data.service.d.ts +0 -40
- package/lib/document/services/document-upload-form.service.d.ts +0 -41
- package/lib/document/services/document-upload.service.d.ts +0 -99
- package/lib/document/services/document-viewer.service.d.ts +0 -97
- package/lib/document/services/document-zoom.service.d.ts +0 -81
- package/lib/document/services/document.service.d.ts +0 -161
- package/lib/document/services/eml-parser.service.d.ts +0 -116
- package/lib/document/services/excel-parser.service.d.ts +0 -169
- package/lib/document/services/file-format.service.d.ts +0 -34
- package/lib/document/services/status-calculator.service.d.ts +0 -20
- package/lib/document/services/user-list.service.d.ts +0 -29
- package/lib/document/state/document.query.d.ts +0 -243
- package/lib/document/state/document.state.d.ts +0 -61
- package/lib/document/state/document.store.d.ts +0 -56
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { EntityStore, StoreConfig } from '@datorama/akita';
|
|
3
|
+
import { createInitialState, DocumentState } from './document.state';
|
|
4
|
+
import { DocumentTypeModel } from '../models/document-type.model';
|
|
5
|
+
import { DocumentCategory } from '../models/document-category.model';
|
|
6
|
+
import { Message } from 'primeng/api';
|
|
7
|
+
import { DocumentModel } from '../models/document.model';
|
|
8
|
+
import { UserListModel } from '../models/user-list.model';
|
|
9
|
+
import { StatusDataModel } from '../models/status-data.model';
|
|
10
|
+
import { DocumentListResponse } from '../models/document-list-response.model';
|
|
11
|
+
import { DocumentListItem } from '../models/document-list-response.model';
|
|
12
|
+
import { DocumentHistorySection } from '../models/document-history.model';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Store that manages the state of documents in the application.
|
|
16
|
+
* The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
|
|
17
|
+
* It uses the `createInitialState` function to initialize the store with default values and
|
|
18
|
+
* is configured with the name `'documents'`.
|
|
19
|
+
* @augments EntityStore<DocumentState>
|
|
20
|
+
*/
|
|
21
|
+
@Injectable({ providedIn: 'root' })
|
|
22
|
+
@StoreConfig({ name: 'documents' })
|
|
23
|
+
export class DocumentStore extends EntityStore<DocumentState> {
|
|
24
|
+
/**
|
|
25
|
+
* Creates an instance of `DocumentStore` with the initial state of the documents.
|
|
26
|
+
*/
|
|
27
|
+
constructor() {
|
|
28
|
+
super(createInitialState());
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
setUploadedDocumentFiles(files: any[]) {
|
|
32
|
+
this.update({ uploadedDocumentFiles: files });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
setFolders(folders: any) {
|
|
36
|
+
this.update({ folders: folders });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setDocumentTypes(documentType: any) {
|
|
40
|
+
this.update({ uploadedDocumentFiles: documentType });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setDocumentAlert(documentAlert: any) {
|
|
44
|
+
this.update({ documentAlert : documentAlert });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
setParentDocumentTypeId(parentDocumentTypeId: string) {
|
|
48
|
+
this.update({ parentDocumentTypeId });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
setMessage(message: Message[]) {
|
|
52
|
+
this.update({ messages : message });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
setDocumentList(documents: DocumentModel[]) {
|
|
56
|
+
this.update({ documents : documents });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
setDocumentCategories(categories: DocumentCategory[]) {
|
|
60
|
+
this.update({ documentCategories: categories });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// New methods for selection state management
|
|
64
|
+
setSelectedMenuItem(menuItem: string | null) {
|
|
65
|
+
this.update({ selectedMenuItem: menuItem });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
setSelectedUserId(userId: string | null) {
|
|
69
|
+
this.update({ selectedUserId: userId });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
setSelectedStatus(status: string | null) {
|
|
73
|
+
this.update({ selectedStatus: status });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setSearchKey(searchKey: string | null) {
|
|
77
|
+
this.update({ searchKey: searchKey });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Method to update all selection properties at once
|
|
81
|
+
setSelectionState(menuItem: string | null, userId: string | null, status: string | null, searchKey: string | null = null) {
|
|
82
|
+
this.update({
|
|
83
|
+
selectedMenuItem: menuItem,
|
|
84
|
+
selectedUserId: userId,
|
|
85
|
+
selectedStatus: status,
|
|
86
|
+
searchKey: searchKey
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Method to clear all selection state
|
|
91
|
+
clearSelectionState() {
|
|
92
|
+
this.update({
|
|
93
|
+
selectedMenuItem: null,
|
|
94
|
+
selectedUserId: null,
|
|
95
|
+
selectedStatus: null,
|
|
96
|
+
searchKey: null,
|
|
97
|
+
showUserList: true
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Method to control user list visibility
|
|
102
|
+
setShowUserList(show: boolean) {
|
|
103
|
+
this.update({ showUserList: show });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Method to set the current document
|
|
107
|
+
setCurrentDocument(document: DocumentModel | null) {
|
|
108
|
+
this.update({ currentDocument: document });
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Method to set the user list
|
|
112
|
+
setUserList(userList: UserListModel[]) {
|
|
113
|
+
this.update({ userList: userList });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Method to set the status data
|
|
117
|
+
setStatusData(statusData: StatusDataModel[]) {
|
|
118
|
+
this.update({ statusData: statusData });
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Method to set the document list response
|
|
122
|
+
setDocumentListResponse(response: DocumentListResponse[] | null) {
|
|
123
|
+
this.update({ documentListResponse: response });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Document Viewer State Management Methods
|
|
127
|
+
setSelectedDocument(document: DocumentListItem | undefined) {
|
|
128
|
+
this.update({ selectedDocument: document });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
setDocumentHistory(history: DocumentHistorySection[]) {
|
|
132
|
+
this.update({ documentHistory: history });
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
setShowDocumentHistory(show: boolean) {
|
|
136
|
+
this.update({ showDocumentHistory: show });
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
setIsActionLoading(loading: boolean) {
|
|
140
|
+
this.update({ isActionLoading: loading });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
setDocumentStatus(status: 'pending' | 'accepted' | 'rejected') {
|
|
144
|
+
this.update({ documentStatus: status });
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
setDocumentIsUploaded(uploaded: boolean) {
|
|
148
|
+
this.update({ documentIsUploaded: uploaded });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
setAlertData(alertData: any) {
|
|
152
|
+
this.update({ alertData: alertData });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
setDeleteError(error: any) {
|
|
156
|
+
this.update({ deleteError: error });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
setDeleteSuccess(success: boolean) {
|
|
160
|
+
this.update({ deleteSuccess: success });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Method to update all document viewer state at once
|
|
164
|
+
updateDocumentViewerState(
|
|
165
|
+
document?: DocumentListItem,
|
|
166
|
+
history?: DocumentHistorySection[],
|
|
167
|
+
showHistory?: boolean,
|
|
168
|
+
loading?: boolean,
|
|
169
|
+
status?: 'pending' | 'accepted' | 'rejected',
|
|
170
|
+
uploaded?: boolean,
|
|
171
|
+
alertData?: any
|
|
172
|
+
) {
|
|
173
|
+
const updates: Partial<DocumentState> = {};
|
|
174
|
+
|
|
175
|
+
if (document !== undefined) updates.selectedDocument = document;
|
|
176
|
+
if (history !== undefined) updates.documentHistory = history;
|
|
177
|
+
if (showHistory !== undefined) updates.showDocumentHistory = showHistory;
|
|
178
|
+
if (loading !== undefined) updates.isActionLoading = loading;
|
|
179
|
+
if (status !== undefined) updates.documentStatus = status;
|
|
180
|
+
if (uploaded !== undefined) updates.documentIsUploaded = uploaded;
|
|
181
|
+
if (alertData !== undefined) updates.alertData = alertData;
|
|
182
|
+
|
|
183
|
+
this.update(updates);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Method to clear document viewer state
|
|
187
|
+
clearDocumentViewerState() {
|
|
188
|
+
this.update({
|
|
189
|
+
selectedDocument: undefined,
|
|
190
|
+
documentHistory: [],
|
|
191
|
+
showDocumentHistory: false,
|
|
192
|
+
isActionLoading: false,
|
|
193
|
+
documentStatus: 'pending' as 'pending',
|
|
194
|
+
documentIsUploaded: false,
|
|
195
|
+
alertData: null,
|
|
196
|
+
deleteError: null,
|
|
197
|
+
deleteSuccess: false
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of cat-document-lib
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
export * from './lib/document/document.module';
|
|
2
6
|
export * from './lib/document/components/document-container/document-container.component';
|
|
3
7
|
export * from './lib/document/components/document-upload/document-upload.component';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"types": []
|
|
11
|
+
},
|
|
12
|
+
"exclude": [
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.lib.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"declarationMap": false
|
|
7
|
+
},
|
|
8
|
+
"angularCompilerOptions": {
|
|
9
|
+
"compilationMode": "partial"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "../../tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../../out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"**/*.spec.ts",
|
|
13
|
+
"**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ConfirmationService } from 'primeng/api';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export interface ConfirmationOptions {
|
|
4
|
-
message: string;
|
|
5
|
-
header?: string;
|
|
6
|
-
icon?: string;
|
|
7
|
-
acceptLabel?: string;
|
|
8
|
-
rejectLabel?: string;
|
|
9
|
-
acceptIcon?: string;
|
|
10
|
-
rejectIcon?: string;
|
|
11
|
-
acceptButtonClass?: string;
|
|
12
|
-
rejectButtonClass?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class ConfirmationDialogComponent {
|
|
15
|
-
private confirmationService;
|
|
16
|
-
confirmationOptions: ConfirmationOptions;
|
|
17
|
-
constructor(confirmationService: ConfirmationService);
|
|
18
|
-
/**
|
|
19
|
-
* Shows the confirmation dialog with the specified options
|
|
20
|
-
* @param options - Configuration options for the confirmation dialog
|
|
21
|
-
* @param acceptCallback - Function to execute when user accepts
|
|
22
|
-
* @param rejectCallback - Function to execute when user rejects
|
|
23
|
-
*/
|
|
24
|
-
confirm(options: Partial<ConfirmationOptions>, acceptCallback: () => void, rejectCallback?: () => void): void;
|
|
25
|
-
/**
|
|
26
|
-
* Static method to show a confirmation dialog (for components that don't want to inject this component)
|
|
27
|
-
* @param confirmationService - The ConfirmationService instance
|
|
28
|
-
* @param options - Configuration options for the confirmation dialog
|
|
29
|
-
* @param acceptCallback - Function to execute when user accepts
|
|
30
|
-
* @param rejectCallback - Function to execute when user rejects
|
|
31
|
-
*/
|
|
32
|
-
static confirm(confirmationService: ConfirmationService, options: Partial<ConfirmationOptions>, acceptCallback: () => void, rejectCallback?: () => void): void;
|
|
33
|
-
/**
|
|
34
|
-
* Static method to show a delete confirmation dialog
|
|
35
|
-
* @param confirmationService - The ConfirmationService instance
|
|
36
|
-
* @param itemName - Name of the item to be deleted
|
|
37
|
-
* @param acceptCallback - Function to execute when user accepts deletion
|
|
38
|
-
* @param rejectCallback - Function to execute when user rejects deletion
|
|
39
|
-
*/
|
|
40
|
-
static confirmDelete(confirmationService: ConfirmationService, itemName: string, acceptCallback: () => void, rejectCallback?: () => void): void;
|
|
41
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationDialogComponent, never>;
|
|
42
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmationDialogComponent, "app-confirmation-dialog", never, { "confirmationOptions": { "alias": "confirmationOptions"; "required": false; }; }, {}, never, never, false, never>;
|
|
43
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ConfirmationDialogComponent>;
|
|
44
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { SHARED } from '../../constant/SHARED';
|
|
3
|
-
import { ProcessedRowData, TableData } from './table-primary.model';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class TablePrimaryComponent implements OnChanges {
|
|
6
|
-
tableData: TableData;
|
|
7
|
-
showHeader: boolean;
|
|
8
|
-
tableStyle: any;
|
|
9
|
-
rowClick: EventEmitter<any>;
|
|
10
|
-
rowCtrlClick: EventEmitter<any>;
|
|
11
|
-
processedData: ProcessedRowData[];
|
|
12
|
-
readonly SHARED: typeof SHARED;
|
|
13
|
-
get visibleColumns(): import("cat-documents-ng").TableColumn[];
|
|
14
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
-
private processTableData;
|
|
16
|
-
getStatusClass(status: string): string;
|
|
17
|
-
getStatusIcon(status: string): string;
|
|
18
|
-
getFileExtension(fileName: string): string;
|
|
19
|
-
onRowClick(event: MouseEvent, rowData: any): void;
|
|
20
|
-
getVisibleColumnCount(): number;
|
|
21
|
-
/**
|
|
22
|
-
* Formats document display name based on whether aliasName exists:
|
|
23
|
-
* - Without aliasName: fileName on top, docName below
|
|
24
|
-
* - With aliasName: aliasName on top, docName - fileName below
|
|
25
|
-
* @param rowData The row data containing docName, aliasName, and fileName
|
|
26
|
-
* @returns HTML string with proper formatting
|
|
27
|
-
*/
|
|
28
|
-
formatDocumentDisplayName(rowData: any): string;
|
|
29
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TablePrimaryComponent, never>;
|
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TablePrimaryComponent, "lib-table-primary", never, { "tableData": { "alias": "tableData"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "tableStyle": { "alias": "tableStyle"; "required": false; }; }, { "rowClick": "rowClick"; "rowCtrlClick": "rowCtrlClick"; }, never, never, false, never>;
|
|
31
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface TableColumn {
|
|
2
|
-
field: string;
|
|
3
|
-
header: string;
|
|
4
|
-
type?: 'text' | 'status' | 'document' | 'actions';
|
|
5
|
-
width?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface TableData {
|
|
8
|
-
columns: TableColumn[];
|
|
9
|
-
data: any[];
|
|
10
|
-
}
|
|
11
|
-
export interface ProcessedRowData {
|
|
12
|
-
_fileExtension?: string;
|
|
13
|
-
_isPdfFile?: boolean;
|
|
14
|
-
_isImageFile?: boolean;
|
|
15
|
-
_isExcelFile?: boolean;
|
|
16
|
-
_isOtherFile?: boolean;
|
|
17
|
-
_statusClass?: string;
|
|
18
|
-
_statusIcon?: string;
|
|
19
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A utility class containing common error messages.
|
|
3
|
-
* @class ERRORS
|
|
4
|
-
*/
|
|
5
|
-
export declare class ERRORS {
|
|
6
|
-
/**
|
|
7
|
-
* Error message for invalid recipient.
|
|
8
|
-
* @static
|
|
9
|
-
* @type {string}
|
|
10
|
-
*/
|
|
11
|
-
static INVALID_RECIPIENT: string;
|
|
12
|
-
static NO_VALUE_FOUND: string;
|
|
13
|
-
/**
|
|
14
|
-
* Error message for invalid document.
|
|
15
|
-
* @static
|
|
16
|
-
* @type {string}
|
|
17
|
-
*/
|
|
18
|
-
static ERROR_FETCHING_DOCUMENTS: string;
|
|
19
|
-
/**
|
|
20
|
-
* Error message for invalid document.
|
|
21
|
-
* @static
|
|
22
|
-
* @type {string}
|
|
23
|
-
*/
|
|
24
|
-
static ERROR_FETCHING_FOLDERS: string;
|
|
25
|
-
/**
|
|
26
|
-
* Error message for invalid document.
|
|
27
|
-
* @static
|
|
28
|
-
* @type {string}
|
|
29
|
-
*/
|
|
30
|
-
static ERROR_ALLDOCUMENT_MISSING: string;
|
|
31
|
-
/**
|
|
32
|
-
* Error message for invalid document.
|
|
33
|
-
* @static
|
|
34
|
-
* @type {string}
|
|
35
|
-
*/
|
|
36
|
-
static ERROR_DOCUMENT_TYPES: string;
|
|
37
|
-
static ERROR_DOCUMENT_CATAGORY: string;
|
|
38
|
-
static NO_DOCUMENT_URL: string;
|
|
39
|
-
static DOWNLOAD_FAIL: string;
|
|
40
|
-
static ERROR_DELETING_DOCUMENT: string;
|
|
41
|
-
static ERROR_RECEIVING_DOCUMENT_LIST: string;
|
|
42
|
-
static CONTEXT_ID_REQUIRED: string;
|
|
43
|
-
static ERROR_FETCHING_STATUS_DATA: string;
|
|
44
|
-
static ERROR_FETCHING_USER_LIST: string;
|
|
45
|
-
static ERROR_FETCHING_DOCUMENT_LIST: string;
|
|
46
|
-
static ERROR_FETCHING_DOCUMENT_CATEGORIES: string;
|
|
47
|
-
static ERROR_FETCHING_DOCUMENTS_BY_STATUS: string;
|
|
48
|
-
static ERROR_FETCHING_DOCUMENTS_BY_CATEGORY: string;
|
|
49
|
-
static ERROR_CALLING_API_WITH_SELECTION: string;
|
|
50
|
-
static ERROR_FILE_NAME_INVALID_CHARACTERS: string;
|
|
51
|
-
static ERROR_FILE_NAME_EMPTY: string;
|
|
52
|
-
}
|